Board Covering

No attempts yetTime limit1sMemory limit128 MB

Problem

You are given a board of n×nn \times n unit squares, where nn is an odd integer with 3n<503 \le n < 50. The squares are numbered consecutively row by row: the squares in the first row (left to right) get numbers 11 to nn, the second row gets n+1n+1 to 2n2n, and so on, down to the bottom-right square, which is numbered n2n^2.

Three of the squares are cut out of the board. We then try to cover the remaining squares with dominoes. Each domino is a 1×21 \times 2 tile that covers exactly two squares sharing an edge. A valid covering uses exactly k=(n23)/2k = (n^2 - 3)/2 dominoes so that every remaining square is covered by exactly one domino and no domino covers a cut-out square.

Determine whether such a covering of the board (with the three squares removed) is possible.

Input

A single line with four integers separated by single spaces: the board size nn, followed by the numbers of the three cut-out squares. The three numbers are distinct and each lies between 11 and n2n^2. The input is always well formed, so your program does not need to validate it.

Output

Print YES if the board with the three squares removed can be completely covered by dominoes under the rules above, otherwise print NO.