#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n * n);
  map<int, int> M;
  map<int, int>::iterator it;
  for (int i = 0; i < n * n; i++) {
    cin >> v[i];
    M[v[i]]++;
  }
  vector<pair<int, int> > va;
  for (it = M.begin(); it != M.end(); it++) {
    va.push_back({it->second, it->first});
  }
  sort(va.begin(), va.end());
  int a[n][n];
  memset(a, 0, sizeof(a));
  int m = (n - 1) / 2;
  int fl = 1;
  for (int i = 0; i < m + 1; i++) {
    for (int j = 0; j < m + 1; j++) {
      int te = 4;
      int le = -1;
      if (i == j && j == m && n % 2)
        te = 1;
      else if ((i == m || j == m) && n % 2)
        te = 2;
      for (int k = 0; k < va.size(); k++) {
        if (va[k].first >= te) {
          va[k].first -= te;
          le = va[k].second;
          break;
        }
      }
      if (le == -1)
        fl = 0;
      else {
        a[i][j] = a[n - i - 1][j] = a[i][n - j - 1] = a[n - i - 1][n - j - 1] =
            le;
      }
    }
  }
  if (!fl)
    cout << "NO";
  else {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        cout << a[i][j] << " ";
      }
      cout << endl;
    }
  }
}
