I. Paint It Black
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You have a matrix $$$A$$$ with $$$N$$$ rows and $$$M$$$ columns. The rows are numbered $$$1, 2, \ldots N$$$, and the columns are numbered $$$1, 2, \ldots M$$$. For each $$$1 \le i \le N$$$ and $$$1 \le j \le M$$$, let $$$(i, j)$$$ denote the cell with row number $$$i$$$ and column number $$$j$$$.

Initially, all of its $$$N \times M$$$ cells are colored white. You want to do the following operation exactly $$$K$$$ times:

  • Choose a rectangular submatrix and paint it black. More formally, choose integers $$$L_1, R_1, L_2, R_2$$$ satisfying $$$1 \le L_1 \le R_1 \le N$$$ and $$$1 \le L_2 \le R_2 \le M$$$, and for each cell $$$(i, j)$$$ satisfying, $$$L_1 \le i \le R_1$$$, $$$L_2 \le j \le R_2$$$, paint it black.

You have a target $$$N \times M$$$ matrix $$$C$$$ consisting of $$$0$$$ and $$$1$$$. For each cell $$$(i, j)$$$, if $$$C_{i,j} = 1$$$, you want the cell to be colored black in the matrix $$$A$$$ and otherwise you want it to remain white.

Find if there exist $$$K$$$ operations that color the matrix as required. Note that, it is allowed to do the same operation multiple times.

Input

The first line contains $$$N, M (1 \le N, M \le 1000)$$$ and $$$K (1 \le K \le 4)$$$, the number of rows, the number of columns, and the required number of operations, respectively.

For each $$$1 \le i \le N$$$, the $$$i^{\text{th}}$$$ of the next $$$N$$$ lines contains a binary string of length $$$M$$$, whose $$$j^{\text{th}}$$$ character is $$$1$$$ if $$$C_{i,j}=1$$$ and $$$0$$$ otherwise.

Output

Print "Yes" (without quotes) if it is possible to convert the matrix into the required state after K operations and "No" (without quotes) otherwise.

Note that the output is case insensitive. So, you can also print "yEs" instead of "Yes".

Examples
Input
5 6 2
000000
001100
001111
000111
000000
Output
Yes
Input
5 6 1
000000
001100
001111
000111
000000
Output
No
Note

In the first sample:

In the first operation, choose the submatrix $$$[2, 3] \times [3, 4]$$$

In the second operation, choose the submatrix $$$[3, 4] \times [4, 6]$$$

In the second sample, one can not obtain the required coloring in $$$1$$$ operation.