#include <bits/stdc++.h>
using namespace std;
int N, v[25][25], freq[1005], x;
int getCif() {
  for (int i = 1; i <= 1000; i++)
    if (freq[i] >= 4) {
      freq[i] -= 4;
      return i;
    }
  return -1;
}
void afis() {
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= N; j++) cout << v[i][j] << " ";
    cout << "\n";
  }
}
int main() {
  cin >> N;
  for (int i = 1; i <= N * N; i++) {
    cin >> x;
    freq[x]++;
  }
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= N; j++) v[i][j] = -1;
  for (int i = 1; i <= N / 2; i++)
    for (int j = 1; j <= N / 2; j++) {
      x = getCif();
      int ii = N - i + 1;
      int jj = N - j + 1;
      v[i][j] = v[i][jj] = v[ii][j] = v[ii][jj] = x;
    }
  if (N % 2 == 0) {
    for (int i = 1; i <= N; i++)
      for (int j = 1; j <= N; j++)
        if (v[i][j] == -1) {
          cout << "NO";
          return 0;
        }
    cout << "YES\n";
    afis();
    return 0;
  }
  int k = 1;
  for (int i = 1; i <= 1000 && k <= N / 2; i++)
    while (freq[i] >= 2 && k <= N / 2) {
      v[k][N / 2 + 1] = v[N - k + 1][N / 2 + 1] = i;
      freq[i] -= 2;
      k++;
    }
  k = 1;
  for (int i = 1; i <= 1000 && k <= N / 2; i++)
    while (freq[i] >= 2 && k <= N / 2) {
      v[N / 2 + 1][k] = v[N / 2 + 1][N - k + 1] = i;
      freq[i] -= 2;
      k++;
    }
  int of = 0;
  k = 0;
  for (int i = 1; i <= 1000; i++)
    if (freq[i] > 0) {
      of++;
      k = i;
    }
  if (of == 1) {
    v[N / 2 + 1][N / 2 + 1] = k;
    cout << "YES\n";
    afis();
  } else
    cout << "NO";
  return 0;
}
