Problem: 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

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
using namespace std;

using Int = long long;
using ll = long long;

template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;};
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;};

template<typename T> void drop(T x){cout<<x<<endl;exit(0);}


signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);

  Int n;
  cin>>n;

  if(n==1){
    cout<<"Yes"<<endl;
    cout<<1<<endl;
    return 0;
  }

  if(n&1) drop("No");

  vector< vector<Int> > ans(n,vector<Int>(n,-1));

  Int cnt=1;
  for(Int i=0;i<n;i++) ans[i][i]=cnt;
  cnt++;

  for(Int t=0;t<2;t++){
    auto add_edge=
      [&](Int p,Int q,Int x){
        p=(p+n)%n;
        q=(q+n)%n;
        if(t==0) if(p>q) swap(p,q);
        if(t==1) if(p<q) swap(p,q);
        ans[p][q]=x;
      };
    for(Int i=0;i<n-1;i++){
      add_edge(i,n-1,cnt);
      for(Int j=1;j<n/2;j++){
        Int p=(i+(n-1)+j)%(n-1);
        Int q=(i+(n-1)-j)%(n-1);
        add_edge(p,q,cnt);
      }
      cnt++;
    }
  }

  cout<<"Yes"<<endl;
  for(Int i=0;i<n;i++){
    for(Int j=0;j<n;j++){
      if(j) cout<<" ";
      cout<<ans[i][j];
    }
    cout<<endl;
  }
  return 0;
}