#include<bits/stdc++.h>

#define pb push_back
#define mp make_pair
#define fi first
#define se second

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

template <typename T> bool chkmax(T &x,T y){return x<y?x=y,true:false;}
template <typename T> bool chkmin(T &x,T y){return x>y?x=y,true:false;}

int readint(){
	int x=0,f=1; char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}

int n;
int ans[505][505];

int main(){
	n=readint();
	if(n==1){
		printf("Yes\n");
		printf("1\n");
		return 0;
	}
	if(n&1) return printf("No\n"),0;
	for(int i=1;i<=n;i++) ans[i][i]=2*n-1;
	for(int i=1;i<n;i++){
		ans[n][i]=2*i-1,ans[i][n]=2*i;
		int nl=i%(n-1)+1,nr=i-1;
		if(nr==0) nr=n-1;
		for(int j=1;j<=n/2-1;j++){
			ans[nl][nr]=2*i-1,ans[nr][nl]=2*i;
			nl=nl%(n-1)+1,nr--;
			if(nr==0) nr=n-1;
		}
	}
	printf("Yes\n");
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			printf("%d",ans[i][j]);
			if(j<n) printf(" ");
		}
		printf("\n");
	}
	return 0;
}

### Prompt

Develop a solution in cpp to the problem described below:

J: Horizontal-Vertical Permutation

Problem Statement

You are given a positive integer N. Your task is to determine if there exists a square matrix A whose dimension is N that satisfies the following conditions and provide an example of such matrices if it exists. A_{i, j} denotes the element of matrix A at the i-th row and j-th column.

* For all i, j (1 \leq i, j \leq N), A_{i, j} is an integer that satisfies 1 \leq A_{i, j} \leq 2N - 1.
* For all k = 1, 2, ..., N, a set consists of 2N - 1 elements from the k-th row or k-th column is \\{1, 2, ..., 2N - 1\\}.



If there are more than one possible matrices, output any of them.

Input


N

Input consists of one line, which contains the integer N that is the size of a square matrix to construct.

Constraint

* N is an integer that satisfies 1 \leq N \leq 500.



Output

Output `No` in a single line if such a square matrix does not exist.

If such a square matrix A exists, output `Yes` on the first line and A after that. More specifically, follow the following format.


Yes
A_{1, 1} A_{1, 2} ... A_{1, N}
A_{2, 1} A_{2, 2} ... A_{2, N}
:
A_{N, 1} A_{N, 2} ... A_{N, N}


Sample Input 1


4

Output for Sample Input 1


Yes
2 6 3 7
4 5 2 1
1 7 5 6
5 3 4 2


Sample Input 2


3

Output for Sample Input 2


No





Example

Input

4


Output

Yes
2 6 3 7
4 5 2 1
1 7 5 6
5 3 4 2

### Response

```cpp
#include<bits/stdc++.h>

#define pb push_back
#define mp make_pair
#define fi first
#define se second

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

template <typename T> bool chkmax(T &x,T y){return x<y?x=y,true:false;}
template <typename T> bool chkmin(T &x,T y){return x>y?x=y,true:false;}

int readint(){
	int x=0,f=1; char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}

int n;
int ans[505][505];

int main(){
	n=readint();
	if(n==1){
		printf("Yes\n");
		printf("1\n");
		return 0;
	}
	if(n&1) return printf("No\n"),0;
	for(int i=1;i<=n;i++) ans[i][i]=2*n-1;
	for(int i=1;i<n;i++){
		ans[n][i]=2*i-1,ans[i][n]=2*i;
		int nl=i%(n-1)+1,nr=i-1;
		if(nr==0) nr=n-1;
		for(int j=1;j<=n/2-1;j++){
			ans[nl][nr]=2*i-1,ans[nr][nl]=2*i;
			nl=nl%(n-1)+1,nr--;
			if(nr==0) nr=n-1;
		}
	}
	printf("Yes\n");
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			printf("%d",ans[i][j]);
			if(j<n) printf(" ");
		}
		printf("\n");
	}
	return 0;
}

```