| Winter Cup 4.0 Online Mirror Contest |
|---|
| Finished |
Oussama, Rami and Yessine were travelling to Egypt in order to participate in a programming contest. Unfortunately, the plane crushed in some unknown island and everyone died except the three of them. They spent the next few months eating coconuts and sleeping on the sands. One day, Yessine found a bottle on the beach. Inside the bottle there was a letter. They found the number $$$800$$$ written on the back of paper so they were curious about it so they started reading the letter. They were shocked to find out that the letter contained some hard problem. Oussama got angry and decided to burn the paper but Rami was really curious about the number $$$800$$$, and he decided to solve it hoping that he might find an explanation. The problem says: You are given a grid of lowercase characters 'a'-'z'. You can do the following operation any number of times :
Rami's stomach hurts from eating too much coconuts so he can't think properly, help him solve the problem.
print a single line containing YES if you can or NO if you can't.
3 3 b aaa aaa aaa
NO
1 1 a a
YES
Note that the top left cell of the grid is $$$(0,0).$$$ And the cell $$$(N-1,M-1)$$$ is the one on the bottom right..
| Name |
|---|


