#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const int MAX_SIZE = 20, MAX_A = 2 * 1000;
int arr[MAX_A], ex[MAX_SIZE][MAX_SIZE];
int n;
int answer[MAX_SIZE][MAX_SIZE];
set<pair<int, int>> q;
int main() {
  cin >> n;
  for (int i = 0; i < n * n; i++) {
    int g;
    cin >> g;
    arr[g] += 1;
  }
  for (int i = 0; i <= MAX_A; i++) {
    if (arr[i] != 0) q.insert(make_pair(arr[i], i));
  }
  int k = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (ex[i][j] == 0) {
        ex[i][j] = ex[i][n - 1 - j] = ex[n - 1 - i][j] =
            ex[n - 1 - i][n - 1 - j] = k;
        k++;
      }
    }
  }
  vector<pair<int, int>> gg;
  for (int i = 1; i < k; i++) {
    int cc = 0;
    for (int p = 0; p < n; p++) {
      for (int r = 0; r < n; r++) cc += ex[p][r] == i;
    }
    gg.push_back(make_pair(cc, i));
  }
  sort(gg.begin(), gg.end());
  reverse(gg.begin(), gg.end());
  for (auto ff : gg) {
    int i = ff.second;
    int cnt = (*q.rbegin()).first, x = (*q.rbegin()).second;
    q.erase(*(q.rbegin()));
    for (int p = 0; p < n; p++) {
      for (int h = 0; h < n; h++) {
        if (ex[p][h] == i) {
          answer[p][h] = x;
          cnt -= 1;
          if (cnt < 0) {
            cout << "NO";
            return 0;
          }
        }
      }
    }
    if (cnt != 0) {
      q.insert(make_pair(cnt, x));
    }
  }
  cout << "YES"
       << "\n";
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << answer[i][j] << ' ';
    }
    cout << "\n";
  }
}
