#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, n, i, j, l, x, k, m, r, q;
  long long int w = 0;
  cin >> n;
  m = n * n;
  long long int b[m + 1], a[n + 1][n + 1];
  map<long long int, long long int> make_pair;
  for (i = 1; i <= m; i++) {
    cin >> b[i];
    make_pair[b[i]]++;
  }
  long long int od = 0, d = 0, p = 0;
  for (auto it : make_pair) {
    d = it.second;
    if (d % 2 != 0) od++;
    if (d % 4 != 0) d = 1;
  }
  if (n % 2 == 0 && d == 1 || n % 2 == 0 && od > 0 || n % 2 != 0 && od != 1)
    cout << "NO\n";
  else {
    if (n % 2 == 0) {
      r = n / 2;
      for (i = 1; i <= r; i++) {
        for (j = 1; j <= r; j++) {
          for (auto it : make_pair) {
            if (it.second > 0) {
              d = it.first;
              make_pair[d] -= 4;
              a[i][j] = d, a[i][n - j + 1] = d, a[n - i + 1][j] = d,
              a[n - i + 1][n - j + 1] = d;
              break;
            }
          }
        }
      }
    } else {
      r = n / 2;
      for (i = 1; i <= r; i++) {
        for (j = 1; j <= r; j++) {
          q = 0;
          for (auto it : make_pair) {
            if (it.second >= 4) {
              q = 1;
              d = it.first;
              make_pair[d] -= 4;
              a[i][j] = d, a[i][n - j + 1] = d, a[n - i + 1][j] = d,
              a[n - i + 1][n - j + 1] = d;
              break;
            }
          }
          if (q == 0) {
            w = 1;
            break;
          }
        }
      }
      d = r, d++;
      for (j = 1; j <= r; j++) {
        q = 0;
        for (auto it : make_pair) {
          if (it.second >= 2) {
            q = 1;
            k = it.first;
            make_pair[k] -= 2;
            a[d][j] = k, a[d][n - j + 1] = k;
            break;
          }
        }
        if (q == 0) w = 1;
      }
      for (i = 1; i <= r; i++) {
        q = 0;
        for (auto it : make_pair) {
          if (it.second >= 2) {
            q = 1;
            k = it.first;
            make_pair[k] -= 2;
            a[i][d] = k, a[n - i + 1][d] = k;
            break;
          }
        }
        if (q == 0) w = 1;
      }
      for (auto it : make_pair) {
        q = 0;
        if (it.second >= 1) {
          q = 1;
          a[d][d] = it.first;
          break;
        }
      }
    }
    if (w)
      cout << "NO\n";
    else {
      cout << "YES\n";
      for (i = 1; i <= n; i++) {
        for (j = 1; j <= n; j++) cout << a[i][j] << " ";
        cout << endl;
      }
      cout << endl;
    }
  }
}
