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.
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author koneko096
 */
public class Main {
  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    CPalindromicMatrix solver = new CPalindromicMatrix();
    solver.solve(1, in, out);
    out.close();
  }

  static class CPalindromicMatrix {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
      PriorityQueue<Pair<Integer, Integer>> pq = new PriorityQueue<>(Collections.reverseOrder());
      int n = in.nextInt(), bef = 0, cnt = 0;
      int[] a = new int[n * n];
      for (int i = 0; i < n * n; i++) {
        a[i] = in.nextInt();
      }
      Arrays.sort(a);
      for (int i = 0; i < n * n; i++) {
        if (bef == a[i]) {
          cnt++;
        } else {
          if (bef > 0)
            pq.add(new Pair<>(cnt, bef));
          bef = a[i];
          cnt = 1;
        }
      }
      pq.add(new Pair<>(cnt, bef));
      int[][] ans = constructShapeVerifier(pq, n);
      if (ans != null) {
        out.println("YES");
        for (int i = 0; i < n; i++) {
          for (int j = 0; j < n; j++) {
            out.print(ans[i][j]);
            out.print(' ');
          }
          out.println();
        }
      } else {
        out.println("NO");
      }
    }

    private int[][] constructShapeVerifier(PriorityQueue<Pair<Integer, Integer>> pq, int n) {
      int[][] M = new int[n][n];
      Pair<Integer, Integer> el;

      // corners
      for (int i = 0; i < n / 2; i++) {
        el = pq.poll();
        if (el == null || el.getFs() < 4)
          return null;
        el.setFs(el.getFs() - 4);
        pq.add(el);
        int num = el.getSc();
        M[i][i] = num;
        M[n - i - 1][i] = num;
        M[i][n - i - 1] = num;
        M[n - i - 1][n - i - 1] = num;
      }

      // vertical edges
      for (int j = 0; j < n / 2; j++) {
        for (int i = j + 1; i < n / 2; i++) {
          el = pq.poll();
          if (el == null || el.getFs() < 4)
            return null;
          el.setFs(el.getFs() - 4);
          pq.add(el);
          int num = el.getSc();
          M[j][i] = num;
          M[j][n - i - 1] = num;
          M[n - j - 1][i] = num;
          M[n - j - 1][n - i - 1] = num;
        }
      }

      // horizontal edges
      for (int j = 0; j < n / 2; j++) {
        for (int i = j + 1; i < n / 2; i++) {
          el = pq.poll();
          if (el == null || el.getFs() < 4)
            return null;
          el.setFs(el.getFs() - 4);
          pq.add(el);
          int num = el.getSc();
          M[i][j] = num;
          M[n - i - 1][j] = num;
          M[i][n - j - 1] = num;
          M[n - i - 1][n - j - 1] = num;
        }
      }

      if ((n & 1) == 1) {
        // vertical central edges
        for (int i = 0; i < n / 2; i++) {
          el = pq.poll();
          if (el == null || el.getFs() < 2)
            return null;
          el.setFs(el.getFs() - 2);
          pq.add(el);
          int num = el.getSc();
          M[i][n / 2] = num;
          M[n - i - 1][n / 2] = num;
        }

        // horizontal central edges
        for (int i = 0; i < n / 2; i++) {
          el = pq.poll();
          if (el == null || el.getFs() < 2)
            return null;
          el.setFs(el.getFs() - 2);
          pq.add(el);
          int num = el.getSc();
          M[n / 2][i] = num;
          M[n / 2][n - i - 1] = num;
        }


        // center
        el = pq.poll();
        if (el == null || el.getFs() < 1)
          return null;
        el.setFs(el.getFs() - 1);
        pq.add(el);
        int num = el.getSc();
        M[n / 2][n / 2] = num;
      }
      return M;
    }

  }


  static class Pair<T1 extends Comparable<T1>, T2 extends Comparable<T2>>
      implements Comparable<Pair<T1, T2>> {
    T1 fs;
    T2 sc;

    public T1 getFs() {
      return fs;
    }

    public void setFs(T1 fs) {
      this.fs = fs;
    }

    public T2 getSc() {
      return sc;
    }

    public Pair(T1 fs, T2 sc) {
      this.fs = fs;
      this.sc = sc;
    }

    public int compareTo(Pair<T1, T2> o) {
      int fc = fs.compareTo(o.fs);
      if (fc != 0) {
        return fc;
      }
      return sc.compareTo(o.sc);
    }

    public String toString() {
      return "<" + "" + fs + ", " + sc + '>';
    }

  }


  static class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream), 32768);
      tokenizer = null;
    }

    public String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public int nextInt() {
      return Integer.parseInt(next());
    }

  }
}

