#include <bits/stdc++.h>
using namespace std;
int temp[1005];
int main() {
  int n, t;
  cin >> n;
  int prak = n;
  for (int i = 1; i <= (n * n); i++) {
    cin >> t;
    temp[t]++;
  }
  int v[n][n];
  int i = 1, j, k = 1;
  int r = 0, c = 0;
  for (; k <= (n / 2) * (n / 2); k++) {
    for (j = 1; j <= 1000; j++) {
      if (temp[j] > 3) break;
    }
    if (j > 1000) {
      cout << "NO" << endl;
      return 0;
    }
    v[r][c] = j;
    v[r][n - 1 - c] = j;
    v[n - 1 - r][c] = j;
    v[n - 1 - r][n - 1 - c] = j;
    temp[j] = temp[j] - 4;
    c++;
    if (c == (n / 2)) {
      c = 0;
      r++;
    }
  }
  if (n & 1) {
    for (int abc = 0; abc < (n / 2); abc++) {
      for (j = 1; j <= 1000; j++) {
        if (temp[j] > 1) break;
      }
      if (j > 1000) {
        cout << "NO" << endl;
        return 0;
      }
      v[n / 2][abc] = j;
      v[n / 2][n - 1 - abc] = j;
      temp[j] -= 2;
    }
    for (int abc = 0; abc < (n / 2); abc++) {
      for (j = 1; j <= 1000; j++) {
        if (temp[j] > 1) break;
      }
      if (j > 1000) {
        cout << "NO" << endl;
        return 0;
      }
      v[abc][n / 2] = j;
      v[n - 1 - abc][n / 2] = j;
      temp[j] -= 2;
    }
    for (j = 1; j <= 1000; j++) {
      if (temp[j]) break;
    }
    if (j > 1000) {
      cout << "NO" << endl;
      return 0;
    }
    v[n / 2][n / 2] = j;
  }
  cout << "YES" << endl;
  for (int i = 0; i < prak; i++) {
    for (int j = 0; j < prak; j++) cout << v[i][j] << " ";
    cout << endl;
  }
}
