#include <bits/stdc++.h>
using namespace std;
long long n;
long long a[100000];
long long res[30][30];
int main() {
  ios::sync_with_stdio(0), cin.tie();
  cin >> n;
  long long n2 = powl(n, 2);
  map<long long, long long> m;
  for (int i = 0; i < n2; i++) cin >> a[i], m[a[i]]++;
  long long w = 0, w2 = 0;
  if (n == 1) return cout << "YES\n" << a[0], 0;
  for (auto c : m) {
    w += (c.second % 4 != 0);
    w2 += (c.second % 2 == 1);
  }
  if (n % 2 == 0 && w >= 1) return cout << "NO", 0;
  if (n % 2 == 1 && w2 != 1) return cout << "NO", 0;
  bool ok = (n % 2 == 1);
  for (int i = 0; i < n; i++) {
    if (i == n / 2) continue;
    for (int j = 0; j < n; j++) {
      if (j == n / 2) continue;
      bool fail = false;
      if (res[i][j] == 0) {
        for (map<long long, long long>::iterator it = m.begin(); it != m.end();
             it++) {
          if (it->second >= 4) {
            fail = true;
            it->second -= 4;
            res[i][j] = res[n - i - 1][j] = it->first;
            res[n - i - 1][n - j - 1] = res[i][n - j - 1] = it->first;
            break;
          }
        }
        if (!fail) return cout << "NO", 0;
      }
    }
  }
  if (ok) {
    long long h = n / 2;
    for (int i = 0; i < h; i++) {
      if (i == h) continue;
      bool fail = false;
      if (res[i][h] != 0) continue;
      for (map<long long, long long>::iterator it = m.begin(); it != m.end();
           it++) {
        if (it->second >= 2) {
          fail = true;
          it->second -= 2;
          res[i][h] = res[n - i - 1][h] = it->first;
          break;
        }
      }
      if (!fail) return cout << "NO", 0;
    }
    long long z = 0;
    for (int i = 0; i < h; i++) {
      if (i == h) continue;
      bool fail = false;
      if (res[h][i] != 0) continue;
      for (map<long long, long long>::iterator it = m.begin(); it != m.end();
           it++) {
        if (it->second % 2 == 1) z = it->first;
        if (it->second >= 2) {
          fail = true;
          it->second -= 2;
          res[h][i] = res[h][n - i - 1] = it->first;
          break;
        }
      }
      if (!fail) return cout << "NO", 0;
    }
    bool ok = false;
    for (auto c : m) {
      if (c.second) {
        ok = true;
        res[h][h] = c.first;
        break;
      }
    }
    if (ok == 0) return cout << "NO", 0;
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cout << res[i][j] << " ";
    cout << endl;
  }
  return 0;
}
