#include <bits/stdc++.h>
using namespace std;
int arr[25][25];
int main() {
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n * n; i++) {
    int x;
    cin >> x;
    mp[x]++;
  }
  int lr = 0, hr = n - 1, lc = 0, hc = n - 1;
  auto it = mp.begin();
  while (lr < hr) {
    lc = 0;
    hc = n - 1;
    while (lc < hc) {
      while (it != mp.end() && it->second < 4) it++;
      if (it == mp.end()) {
        cout << "NO";
        return 0;
      }
      arr[lr][lc] = arr[lr][hc] = arr[hr][lc] = arr[hr][hc] = it->first;
      it->second -= 4;
      lc++;
      hc--;
    }
    lr++;
    hr--;
  }
  if (n & 1) {
    auto it = mp.begin();
    for (int i = 0; i < n / 2; i++) {
      while (it != mp.end() && it->second < 2) it++;
      if (it == mp.end()) {
        cout << "NO";
        return 0;
      }
      arr[n / 2][i] = arr[n / 2][n - 1 - i] = it->first;
      it->second -= 2;
    }
    for (int i = 0; i < n / 2; i++) {
      while (it != mp.end() && it->second < 2) it++;
      if (it == mp.end()) {
        cout << "NO";
        return 0;
      }
      arr[i][n / 2] = arr[n - 1 - i][n / 2] = it->first;
      it->second -= 2;
    }
    it = mp.begin();
    while (it != mp.end() && !(it->second)) it++;
    arr[n / 2][n / 2] = it->first;
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cout << arr[i][j] << " ";
    cout << "\n";
  }
}
