#include <bits/stdc++.h>
using namespace std;
long long x[3][(1 << 20) + 2];
map<int, int> mp;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(), cout.tie();
  int n, i, j, a;
  cin >> n;
  int si = n * n;
  for (i = 0; i < si; i++) {
    cin >> a;
    mp[a]++;
  }
  set<pair<int, int>, greater<pair<int, int> > > v;
  for (auto it = mp.begin(); it != mp.end(); it++) {
    v.insert(make_pair(it->second, it->first));
  }
  a = n;
  int x, y, z, l;
  int ar[22][22];
  for (int k = 0, l = n - 1; k < n / 2; k++, l--) {
    for (i = 0, j = n - 1; i < n / 2; i++, j--) {
      auto it = v.begin();
      if (it->first >= 4) {
        ar[k][i] = it->second;
        ar[k][j] = it->second;
        ar[l][i] = it->second;
        ar[l][j] = it->second;
        x = it->first;
        x -= 4;
        y = it->second;
        v.erase(v.begin());
        if (x > 0) v.insert(make_pair(x, y));
      }
    }
  }
  if (n % 2) {
    for (i = 0, j = n - 1; i < n / 2; i++, j--) {
      auto it = v.begin();
      if (it->first >= 2) {
        ar[i][n / 2] = ar[j][n / 2] = it->second;
        x = it->first;
        x -= 2;
        y = it->second;
        v.erase(v.begin());
        if (x > 0) v.insert(make_pair(x, y));
      }
      it = v.begin();
      if (it->first >= 2) {
        ar[n / 2][i] = ar[n / 2][j] = it->second;
        x = it->first;
        x -= 2;
        y = it->second;
        v.erase(v.begin());
        if (x > 0) v.insert(make_pair(x, y));
      }
    }
    ar[n / 2][n / 2] = v.begin()->second;
    v.erase(v.begin());
  }
  if (v.empty()) {
    cout << "YES\n";
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) cout << ar[i][j] << " ";
      cout << endl;
    }
  } else
    cout << "NO\n";
  return 0;
}
