eolymp
bolt
Try our new interface for solving problems
Problems

Domino 2

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 (1m, n40) - 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.

Time limit 1 second
Memory limit 128 MiB
Input example #1
2 3
...
XXX
Output example #1
NO
Input example #2
3 2
.X
..
X.
Output example #2
YES