#include <bits/stdc++.h>
using namespace std;
int n;
int a[405];
int b[21][21];
int f[1005];
void solve() {
  cin >> n;
  int maxi = 1;
  for (int i = 0; i < n * n; i++) {
    cin >> a[i];
    f[a[i]]++;
    maxi = max(maxi, a[i]);
  }
  priority_queue<pair<int, int> > pq;
  for (int i = 1; i <= maxi; i++) {
    if (f[i] > 0) pq.push(pair<int, int>(f[i], i));
  }
  int i = 0, j = n - 1;
  int i1 = n - 1, j1 = n - 1;
  while (i < j) {
    i1 = 0, j1 = n - 1;
    while (i1 < j1) {
      pair<int, int> p = pq.top();
      pq.pop();
      int v = p.second;
      int fr = p.first;
      if (fr < 4) {
        cout << "NO";
        return;
      }
      b[i][i1] = v;
      b[i][j1] = v;
      b[j][i1] = v;
      b[j][j1] = v;
      if (fr - 4 > 0) pq.push(pair<int, int>(fr - 4, v));
      i1++;
      j1--;
    }
    i++;
    j--;
  }
  if (n % 2) {
    i = n / 2;
    i1 = 0, j1 = n - 1;
    while (i1 < j1) {
      pair<int, int> p = pq.top();
      pq.pop();
      int v = p.second;
      int fr = p.first;
      if (fr < 2) {
        cout << "NO";
        return;
      }
      b[i][i1] = v;
      b[i][j1] = v;
      if (fr - 2 > 0) pq.push(pair<int, int>(fr - 2, v));
      i1++;
      j1--;
    }
    i1 = 0, j1 = n - 1;
    while (i1 < j1) {
      pair<int, int> p = pq.top();
      pq.pop();
      int v = p.second;
      int fr = p.first;
      if (fr < 2) {
        cout << "NO";
        return;
      }
      b[i1][i] = v;
      b[j1][i] = v;
      if (fr - 2 > 0) pq.push(pair<int, int>(fr - 2, v));
      i1++;
      j1--;
    }
    pair<int, int> p = pq.top();
    int v = p.second;
    if (p.first > 1) {
      cout << "NO";
      return;
    }
    b[n / 2][n / 2] = v;
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << b[i][j] << " ";
    }
    cout << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
}
