시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 9 8 8 88.889%

문제

We want to create a program to check the result of a tic tac toe game. A tic tac toe board is a 3x3 grid. Each position can contain either X or O. The game finishes with a winner when a player creates a straight line of 3 equal symbols. The next 3 boards show finished games with a winner. The empty positions are represented using dots. 

X.X     OX.    .X.
OOO     .O.    .X.
...     X.O    .XO

In contrast, these 3 boards have not finished with a winne

OXO    X..    ...
XXO    O.O    .X.
OOX    .XX    ..O

입력

The test case consists of 3 lines. Each one with 3 characters (dot, Oor X). Note that we are using the letter “o” not the digit zero.

출력

For each test case, write YES if the board finished with a winner or NO if there is no winner.

예제 입력

XXX
.OO
OO.

예제 출력

YES

예제 입력 2

XOX
OXO
OXO

예제 출력 2

NO

힌트