시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB28151460.870%

문제

Given a positive integer $n$, you should construct an $n \times n$ integer matrix $M$ satisfying the following conditions:

  • For all elements $M_{i,j}$ ($1 \le i, j \le n$), the absolute value $|M_{i,j}| \le 1$.
  • The row and column sums $R_1, R_2, \ldots, R_n, C_1, C_2, \ldots, C_n$ are pairwise distinct, where $R_x = \sum_{i = 1}^{n} M_{x,i}$ and $C_x = \sum_{i = 1}^{n} M_{i,x}$.

There may exist multiple solutions or no solution.

입력

The first line contains a single integer $n$ ($1 \le n \le 1000$).

출력

The first line must contain one string "Yes" (without quotes) if a solution exists, or "No" (without quotes) if there is no solution.

When a solution exists, print $n$ more lines, each containing $n$ integers, denoting the matrix $M$ you construct.

If multiple solutions exist, print any one of them.

예제 입력 1

2

예제 출력 1

Yes
1 0
1 -1

예제 입력 2

1

예제 출력 2

No

노트

  • In the first example, $R_1 = 1$, $R_2 = 0$, $C_1 = 2$, and $C_2 = -1$ are all distinct.
  • In the second example, $R_1 = C_1$ always holds, so no solution exists.