#include <bits/stdc++.h>
using namespace std;
long long const inf = 1e9;
long long const mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  int a[n * n];
  int cnt[1005];
  memset(cnt, 0, sizeof(cnt));
  for (int i = (0); i < (n * n); i++) {
    cin >> a[i];
    cnt[a[i]]++;
  }
  if (n == 1) {
    cout << "YES" << endl;
    cout << a[0] << endl;
    return 0;
  }
  int r[n][n];
  memset(r, -1, sizeof(r));
  if (n % 2) {
    int x = 0, y = 0;
    for (int i = (1); i < (1001); i++) {
      if (cnt[i] < 4) continue;
      r[x][y] = r[x][n - y - 1] = r[n - x - 1][y] = r[n - x - 1][n - y - 1] = i;
      y++;
      if (y == n / 2) {
        x++, y = 0;
      }
      cnt[i] -= 4;
      if (x == n / 2) break;
      if (cnt[i] >= 4) i--;
    }
    int h = 0;
    for (int i = (1); i < (1001); i++) {
      if (cnt[i] < 2) continue;
      r[n / 2][h] = r[n / 2][n - h - 1] = i;
      h++;
      cnt[i] -= 2;
      if (h == n / 2) break;
      if (cnt[i] >= 2) i--;
    }
    h = 0;
    for (int i = (1); i < (1001); i++) {
      if (cnt[i] < 2) continue;
      r[h][n / 2] = r[n - h - 1][n / 2] = i;
      h++;
      cnt[i] -= 2;
      if (h == n / 2) break;
      if (cnt[i] >= 2) i--;
    }
    for (int i = (1); i < (1001); i++) {
      if (cnt[i] >= 1) {
        r[n / 2][n / 2] = i;
        cnt[i]--;
      }
    }
    for (int i = (1); i < (1001); i++) {
      if (cnt[i] > 0) {
        cout << "NO" << endl;
        return 0;
      }
    }
    for (int i = (0); i < (n); i++) {
      for (int j = (0); j < (n); j++) {
        if (r[i][j] == -1) {
          cout << "NO" << endl;
          return 0;
        }
      }
    }
    cout << "YES" << endl;
    for (int i = (0); i < (n); i++) {
      for (int j = (0); j < (n); j++) {
        cout << r[i][j] << ' ';
      }
      cout << endl;
    }
  } else {
    int x = 0, y = 0;
    for (int i = (1); i < (1001); i++) {
      if (!cnt[i]) continue;
      if (cnt[i] % 4) {
        cout << "NO" << endl;
        return 0;
      }
      r[x][y] = r[x][n - y - 1] = r[n - x - 1][y] = r[n - x - 1][n - y - 1] = i;
      y++;
      if (y == n / 2) {
        x++, y = 0;
      }
      cnt[i] -= 4;
      if (cnt[i] > 0) i--;
    }
    cout << "YES" << endl;
    for (int i = (0); i < (n); i++) {
      for (int j = (0); j < (n); j++) {
        cout << r[i][j] << ' ';
      }
      cout << endl;
    }
  }
  return 0;
}
