Competitions
Maximum flow and matchings
Domino 2
The rectangular board is given. Some of its cells are cut. Determine is it possible to cover the remaining cells with domino tiles.
Input
The first line contains two integers m and n (1 ≤ m, n ≤ 40) - the dimensions of the board. Each of the next m lines contains n symbols. The i-th character of j-th line equals to "X" (Latin big X), if the cell is cut, and "." (point) if the cell is empty.
Output
Print "YES" if its possible to cover the board with domino tiles, and "NO" otherwise.
Input example #1
2 3 ... XXX
Output example #1
NO
Input example #2
3 2 .X .. X.
Output example #2
YES