시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB61423672.000%

문제

You just finished disking your field and it is time to head back to the farmhouse. Some of the livestock has been acting up (you think it is the Clydesdale horses but you’re not sure) and putting up obstacles to prevent you from getting home.

입력

The first line contains a single positive integer, n, denoting the side length of the square field. The next n lines will consist of a map of your field, with ‘.’ denoting an open space and ‘x’ denoting an obstacle. You are in the top left corner of the field and the farmhouse is in the bottom right corner of the field. You don’t have a lot of gas in the tractor, so each move you make must be either down or right (no backtracking).

출력

Print “Yes” if there is a simple path (down and right moves only) to your farm house. If there is no simple path print “No”.

예제 입력 1

6
..x...
.x....
....x.
xx.x..
..x...
......

예제 출력 1

No

예제 입력 2

5
.x.x.
.....
xxx..
....x
.x...

예제 출력 2

Yes