#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int a[405], n;
int sum[1005];
int m[25][25];
int main() {
  memset(sum, 0, sizeof(sum));
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n * n; i++) {
    cin >> a[i];
    sum[a[i]]++;
  }
  for (int i = 1; i <= n / 2; i++) {
    for (int j = 1; j <= n / 2; j++) {
      bool ok = 0;
      for (int k = 1; k <= 1000; k++) {
        if (sum[k] >= 4) {
          m[i][j] = m[i][n + 1 - j] = m[n + 1 - i][j] =
              m[n + 1 - i][n + 1 - j] = k;
          sum[k] -= 4;
          ok = 1;
          break;
        }
      }
      if (ok == 0) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  if (n % 2 == 1) {
    for (int i = 1; i <= n / 2; i++) {
      bool ok = 0;
      for (int k = 1; k <= 1000; k++) {
        if (sum[k] >= 2) {
          m[n / 2 + 1][i] = m[n / 2 + 1][n + 1 - i] = k;
          ok = 1;
          sum[k] -= 2;
          break;
        }
      }
      if (!ok) {
        cout << "NO" << endl;
        return 0;
      }
    }
    for (int i = 1; i <= n / 2; i++) {
      bool ok = 0;
      for (int k = 1; k <= 1000; k++) {
        if (sum[k] >= 2) {
          m[i][n / 2 + 1] = m[n + 1 - i][n / 2 + 1] = k;
          ok = 1;
          sum[k] -= 2;
          break;
        }
      }
      if (!ok) {
        cout << "NO" << endl;
        return 0;
      }
    }
    for (int k = 1; k <= 1000; k++) {
      if (sum[k] >= 1) {
        sum[k]--;
        m[n / 2 + 1][n / 2 + 1] = k;
        break;
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cout << m[i][j] << ' ';
    }
    cout << endl;
  }
  return 0;
}
