#include <bits/stdc++.h>
using namespace std;
int n, a[500];
int grid[25][25];
bool terisi[25][25];
map<int, int> many;
int main() {
  cin >> n;
  for (int i = 0; i < n * n; i++) {
    cin >> a[i];
    many[a[i]]++;
  }
  int mid = n / 2;
  bool ada;
  memset(terisi, 0, sizeof(terisi));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (n % 2 == 1 && (i == mid || j == mid)) {
        continue;
      } else {
        if (!terisi[i][j]) {
          ada = false;
          for (auto it : many) {
            if (it.second >= 4) {
              grid[i][j] = it.first;
              grid[n - i - 1][j] = it.first;
              grid[i][n - j - 1] = it.first;
              grid[n - i - 1][n - j - 1] = it.first;
              terisi[i][j] = 1;
              terisi[n - i - 1][j] = 1;
              terisi[i][n - j - 1] = 1;
              terisi[n - i - 1][n - j - 1] = 1;
              many[it.first] -= 4;
              ada = true;
              break;
            }
          }
          if (!ada) {
            cout << "NO\n";
            return 0;
          }
        }
      }
    }
  }
  if (n % 2 == 1) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (i == mid && j == mid) continue;
        if (!terisi[i][j]) {
          ada = false;
          for (auto it : many) {
            if (it.second >= 2) {
              grid[i][j] = it.first;
              grid[n - i - 1][j] = it.first;
              grid[i][n - j - 1] = it.first;
              grid[n - i - 1][n - j - 1] = it.first;
              terisi[i][j] = 1;
              terisi[n - i - 1][j] = 1;
              terisi[i][n - j - 1] = 1;
              terisi[n - i - 1][n - j - 1] = 1;
              many[it.first] -= 2;
              ada = true;
              break;
            }
          }
          if (!ada) {
            cout << "NO\n";
            return 0;
          }
        }
      }
    }
    ada = false;
    for (auto it : many) {
      if (it.second >= 1) {
        grid[mid][mid] = it.first;
        ada = true;
        break;
      }
    }
    if (!ada) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (j) cout << ' ';
      cout << grid[i][j];
    }
    cout << '\n';
  }
  return 0;
}
