#D10754. Sum Matrix
Sum Matrix
Sum Matrix
You received a card at a banquet. On the card, a matrix of rows and columns and two integers and are written. All the elements in the matrix are integers, and an integer at the -th row from the top and the -th column from the left is denoted by .
You can select up to elements from the matrix and invert the sign of the elements. If you can make a matrix such that there is no vertical or horizontal contiguous subsequence whose sum is greater than , you can exchange your card for a prize.
Your task is to determine if you can exchange a given card for a prize.
Input
The input consists of a single test case of the following form.
... : ...
The first line consists of four integers and ($1 \leq N, M \leq 10, 1 \leq K \leq 5, 1 \leq S \leq 10^6$). The following lines represent the matrix in your card. The ()-th line consists of integers ().
Output
If you can exchange your card for a prize, print 'Yes'. Otherwise, print 'No'.
Examples
Input
3 3 2 10 5 3 7 2 6 1 3 4 1
Output
Yes
Input
2 3 1 5 4 8 -2 -2 -5 -3
Output
Yes
Input
2 3 1 5 9 8 -2 -2 -5 -3
Output
No
Input
2 2 3 100 0 0 0 0
Output
Yes
inputFormat
Input
The input consists of a single test case of the following form.
... : ...
The first line consists of four integers and ($1 \leq N, M \leq 10, 1 \leq K \leq 5, 1 \leq S \leq 10^6$). The following lines represent the matrix in your card. The ()-th line consists of integers ().
outputFormat
Output
If you can exchange your card for a prize, print 'Yes'. Otherwise, print 'No'.
Examples
Input
3 3 2 10 5 3 7 2 6 1 3 4 1
Output
Yes
Input
2 3 1 5 4 8 -2 -2 -5 -3
Output
Yes
Input
2 3 1 5 9 8 -2 -2 -5 -3
Output
No
Input
2 2 3 100 0 0 0 0
Output
Yes
样例
2 2 3 100
0 0
0 0
Yes