The Queen's Journey 4#5729

The Queen's Journey 4

1 segundo
64 megabytes
Fácil

You are given a list of squares on a 8 \times 8 chessboard, represented as a sequence of positions of a queen in chess notation. Determine whether this sequence describes a unique route by the queen that visits every square on the board.

A square is considered visited if it lies on any straight-line move (by chess rules) of the queen in the sequence, even if the square is not explicitly listed.

Entrada

The input consists of a single line containing the queen's path on the chessboard, expressed as a sequence of moves in chess notation (see examples). The length of the line is always even and does not exceed characters. The sequence is guaranteed to consist of valid queen moves according to chess rules.

Salida

Print Yes if the sequence describes a unique queen's route that visits every square on the board. Otherwise, print No. Do not print quotes.

Ejemplos

Ejemplo 1

Loading
Loading