#include <bits/stdc++.h>
using namespace std;
unsigned int n;
priority_queue<pair<int, int>> pq;
vector<vector<int>> v;
int rev(int k) { return n - k - 1; }
void fail() {
  cout << "NO" << endl;
  exit(0);
}
void put(const vector<pair<int, int>>& pos) {
  auto t = pq.top();
  pq.pop();
  if (t.first < pos.size()) {
    fail();
  }
  for (auto p : pos) {
    v[p.first][p.second] = t.second;
  }
  t.first -= pos.size();
  pq.push(t);
}
int main() {
  cin >> n;
  map<int, int> cnts;
  for (int i = 0; i < n * n; i++) {
    int val;
    cin >> val;
    cnts[val]++;
  }
  for (auto p : cnts) {
    pq.push(make_pair(p.second, p.first));
  }
  v = vector<vector<int>>(n, vector<int>(n));
  int half = n / 2;
  for (int i = 0; i < half; i++) {
    for (int j = 0; j < half; j++) {
      put({{i, j}, {i, rev(j)}, {rev(i), j}, {rev(i), rev(j)}});
    }
  }
  if (n % 2 != 0) {
    for (int i = 0; i < half; i++) {
      put({{i, half}, {rev(i), half}});
      put({{half, i}, {half, rev(i)}});
    }
    put({{half, half}});
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << v[i][j] << " ";
    }
    cout << endl;
  }
}
