#GYM104787K. Make SYSU Great Again II

Make SYSU Great Again II

Description

As you know, you guys are participating in CCPC (Chinese Constructive Problem Contest), and no doubt that the proposition school SYSU, as the kingdom of constructive problems, is going to challenge you to solve some related problems.

Given an $n \times n$ grid, you are asked to fill each cell with a number within $[0,4n^2-1]$, and it needs to fulfill the following requirements.

  1. Each number occurs at most $5$ times.
  2. Each cell should be filled with exactly one number.
  3. For any two adjacent cells with a common edge, their bitwise AND value should be exactly equal to $0$.

Construct a valid solution, or report it's impossible.

The only line contains a single number $n\ (1\le n\le 2000)$, representing the size of the grid.

If a valid solution exists, first output Yes on a single line. Then, output an $n\times n$ integer matrix, where each number is in the range $[0, 4n^2-1]$, representing the constructed matrix.

If there are multiple valid solutions, output any one of them.

If a valid solution does not exist, just output No on a single line.

Input

The only line contains a single number $n\ (1\le n\le 2000)$, representing the size of the grid.

Output

If a valid solution exists, first output Yes on a single line. Then, output an $n\times n$ integer matrix, where each number is in the range $[0, 4n^2-1]$, representing the constructed matrix.

If there are multiple valid solutions, output any one of them.

If a valid solution does not exist, just output No on a single line.

4
Yes
0 0 0 0
0 1 2 1
1 2 1 2
2 1 2 4