Justin thinks a matrix is as adorable as Jono if the matrix contains only even numbers. Joon, the twin sister of Jono, wants to gift Justin a matrix $A$ of size $N \times M$ as his birthday present. Unfortunately, her matrix may not be as adorable as Jono. Therefore, he decides to alter his matrix by performing the following the following action for as many times as he wishes:
- Select two elements in the matrix, then set them both to be the sum of the both elements. Formally, select four indices $i_1, i_2, j_1, j_2$ where $1 \le i_1, i_2 \le N, 1 \le j_1, j_2 \le M$ and $(i_1, j_1) \neq (i_2, j_2)$. Set both $A_{i_1, j_1}$ and $A_{i_2, j_2}$ to $A_{i_1, j_1}+A_{i_2, j_2}$.
However, Joon is busy with her freelances. As Joon's best friend, help her determine if she is able to make Joon's matrix as adorable as Jono.
Input
The first line of the input contains two integers, $N$ and $M$. $(2 \le N \times M \le 10^6)$
The next $M$ lines contains $N$ numbers separated by spaces describing the matrix rows of $A (0 \le A_{i, j} \le 10^{18})$.
Output
Output "Yes" (without quotes) if Joon can make $A$ as adorable as Jono, else output "No" (without quotes).
Sample Test Cases
Input | Output | |
---|---|---|
3 2 2 2 2 2 1 1 |
Yes |
Scoring: Per Subtask
Authored by s17r28
Appeared in 2022 Plastic Contest