#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e3 + 5;
int freq[MAX];
int n;
int a[20][20];
priority_queue<pair<int, int>> q;
int rev(int i) { return n - i - 1; }
void put(vector<pair<int, int>> pos) {
  auto t(q.top());
  q.pop();
  if (t.first < pos.size()) {
    cout << "NO" << endl;
    exit(0);
  }
  for (pair<int, int> p : pos) a[p.first][p.second] = t.second;
  t.first -= pos.size();
  q.push(t);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (int i = 0; i < n * n; i++) {
    int ele;
    cin >> ele;
    freq[ele]++;
  }
  for (int i = 0; i < MAX; i++) {
    if (freq[i]) q.push(make_pair(freq[i], i));
  }
  vector<pair<int, int>> pos;
  for (int i = 0; i < n / 2; i++) {
    for (int j = 0; j < n / 2; j++) {
      pos.clear();
      pos.push_back(make_pair(i, j));
      pos.push_back(make_pair(i, rev(j)));
      pos.push_back(make_pair(rev(i), j));
      pos.push_back(make_pair(rev(i), rev(j)));
      put(pos);
    }
  }
  if (n % 2) {
    for (int i = 0; i < n / 2; i++) {
      pos.clear();
      pos.push_back(make_pair(i, n / 2));
      pos.push_back(make_pair(rev(i), n / 2));
      put(pos);
      pos.clear();
      pos.push_back(make_pair(n / 2, i));
      pos.push_back(make_pair(n / 2, rev(i)));
      put(pos);
    }
    pos.clear();
    pos.push_back(make_pair(n / 2, n / 2));
    put(pos);
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << a[i][j] << " ";
    }
    cout << endl;
  }
}
