#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const int N = 1001;
int cnt[N];
int a[20][20];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < n * n; i++) {
    int t;
    cin >> t;
    cnt[t]++;
  }
  vector<pair<int, pair<int, int>>> cells;
  for (int i = 0; i < (n + 1) / 2; i++) {
    for (int j = 0; j < (n + 1) / 2; j++) {
      if (i != n - 1 - i && j != n - 1 - j) {
        cells.push_back({4, {i, j}});
      } else if ((i != n - 1 - i) ^ (j != n - 1 - j)) {
        cells.push_back({2, {i, j}});
      } else {
        cells.push_back({1, {i, j}});
      }
    }
  }
  for (int cur : {4, 2, 1}) {
    int pos = 1;
    for (auto it : cells) {
      if (it.first != cur) continue;
      int i = it.second.first;
      int j = it.second.second;
      while (pos < N && cnt[pos] < cur) {
        pos++;
      }
      if (pos == N) {
        cout << "NO";
        return 0;
      }
      a[i][j] = a[i][n - 1 - j] = a[n - 1 - i][j] = a[n - 1 - i][n - 1 - j] =
          pos;
      cnt[pos] -= cur;
    }
  }
  cout << "YES" << '\n';
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << a[i][j] << ' ';
    }
    cout << '\n';
  }
  return 0;
}
