Problem: Let's call some square matrix with integer values in its cells palindromic if it doesn't change after the order of rows is reversed and it doesn't change after the order of columns is reversed.

For example, the following matrices are palindromic:

<image>

The following matrices are not palindromic because they change after the order of rows is reversed:

<image>

The following matrices are not palindromic because they change after the order of columns is reversed:

<image>

You are given n^2 integers. Put them into a matrix of n rows and n columns so that each number is used exactly once, each cell contains exactly one number and the resulting matrix is palindromic. If there are multiple answers, print any. If there is no solution, print "NO".

Input

The first line contains one integer n (1 ≤ n ≤ 20).

The second line contains n^2 integers a_1, a_2, ..., a_{n^2} (1 ≤ a_i ≤ 1000) — the numbers to put into a matrix of n rows and n columns.

Output

If it is possible to put all of the n^2 numbers into a matrix of n rows and n columns so that each number is used exactly once, each cell contains exactly one number and the resulting matrix is palindromic, then print "YES". Then print n lines with n space-separated numbers — the resulting matrix.

If it's impossible to construct any matrix, then print "NO".

You can print each letter in any case (upper or lower). For example, "YeS", "no" and "yES" are all acceptable.

Examples

Input


4
1 8 8 1 2 2 2 2 2 2 2 2 1 8 8 1


Output


YES
1 2 2 1
8 2 2 8
8 2 2 8
1 2 2 1


Input


3
1 1 1 1 1 3 3 3 3


Output


YES
1 3 1
3 1 3
1 3 1


Input


4
1 2 1 9 8 4 3 8 8 3 4 8 9 2 1 1


Output


NO


Input


1
10


Output


YES
10 

Note

Note that there exist multiple answers for the first two examples.

Solution (in PYTHON3):

Solution:
#Code by Sounak, IIESTS
#------------------------------warmup----------------------------

import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
from collections import defaultdict
from itertools import permutations
 

BUFSIZE = 8192
 
 
class FastIO(IOBase):
    newlines = 0
    
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
     
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
  
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
 
#-------------------game starts now-----------------------------------------------------
n=int(input())
a=list(map(int,input().split()))
d=dict()
for i in a:
    if i in d:
        d[i]+=1
    else:
        d[i]=1
four=list()
two=list()
one=list()
for i in d:
    c=d[i]
    #print(i,d[i])
    for j in range (c//4):
        four.append(i)
    c%=4
    for j in range (c//2):
        two.append(i)
    c%=2
    if c>0:
        one.append(i)
#print(four)
#print(two)
#print(one)
if n%2==0:
    if len(four)!=(n//2)*(n//2):
        print("NO")
    else:
        print("YES")
        r=[[0 for i in range (n)]for j in range (n)]
        k=0
        for i in range (n//2):
            for j in range (n//2):
                r[i][j]=four[k]
                r[i][n-1-j]=four[k]
                r[n-1-i][j]=four[k]
                r[n-1-i][n-1-j]=four[k]
                k+=1
        for i in range (n):
            print(*r[i])
else:
    if len(one)>1 or len(two)>(n//2)*2:
        print("NO")
    else:
        print("YES")
        r=[[0 for i in range (n)]for j in range (n)]
        k=0
        for i in range (n//2):
            for j in range (n//2):
                r[i][j]=four[k]
                r[i][n-1-j]=four[k]
                r[n-1-i][j]=four[k]
                r[n-1-i][n-1-j]=four[k]
                k+=1
        #print(k)
        while k<len(four):
            two.append(four[k])
            two.append(four[k])
            k+=1
        r[n//2][n//2]=one[0]
        k=0
        for i in range (n//2):
            r[i][n//2]=two[k]
            r[n-1-i][n//2]=two[k]
            k+=1
        for j in range (n//2):
            r[n//2][j]=two[k]
            r[n//2][n-1-j]=two[k]
            k+=1
        for i in range (n):
            print(*r[i])