#include <bits/stdc++.h>
using namespace std;
const long long N = 21;
long long n, x, odd, even, res[N][N];
map<long long, long long> m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 1; i <= n * n; ++i) {
    cin >> x;
    ++m[x];
  }
  odd = 0;
  for (auto& v : m) {
    if (v.second % 4 == 1) ++odd;
  }
  for (long long i = 1; i <= n / 2; ++i) {
    for (long long j = 1; j <= n / 2; ++j) {
      if (res[i][j] != 0) continue;
      for (auto& v : m) {
        if (v.second >= 4) {
          res[i][j] = res[i][n + 1 - j] = res[n + 1 - i][j] =
              res[n + 1 - i][n + 1 - j] = v.first;
          v.second -= 4;
          goto lap;
        }
      }
      cout << "NO";
      return 0;
    lap:;
    }
  }
  if (n & 1) {
    for (long long i = 1; i <= n / 2; ++i) {
      for (auto& v : m) {
        if (v.second >= 2) {
          res[i][(n + 1) / 2] = res[n + 1 - i][(n + 1) / 2] = v.first;
          v.second -= 2;
          goto lap1;
        }
      }
      cout << "NO";
      return 0;
    lap1:;
      for (auto& v : m) {
        if (v.second >= 2) {
          res[(n + 1) / 2][i] = res[(n + 1) / 2][n + 1 - i] = v.first;
          v.second -= 2;
          goto lap2;
        }
      }
      cout << "NO";
      return 0;
    lap2:;
    }
    for (auto& v : m) {
      if (v.second > 0) {
        res[(n + 1) / 2][(n + 1) / 2] = v.first;
        goto lap3;
      }
    }
    cout << "NO";
    return 0;
  lap3:;
  }
  cout << "YES\n";
  for (long long i = 1; i <= n; ++i) {
    for (long long j = 1; j <= n; ++j) cout << res[i][j] << " ";
    cout << endl;
  }
  return 0;
}
