#include <bits/stdc++.h>
using namespace std;
const int maxn = 300005;
const int INF = 0x3f3f3f3f;
struct node {
  int l, r;
  bool operator<(const node &a) const { return l < a.l; }
} an[maxn];
long long n, ans;
int k;
int a[1405];
int g[30][30];
int num(int sum) {
  while (k <= 1000 && a[k] < sum) k++;
  if (k > 1000) {
    cout << "NO" << endl;
    exit(0);
  }
  a[k] -= sum;
  return k;
}
int solve() {
  int x;
  cin >> n;
  for (int i = 0; i < n * n; i++) {
    cin >> x;
    a[x]++;
  }
  k = 1;
  for (int i = 1; i <= n / 2; i++) {
    for (int j = 1; j <= n / 2; j++) {
      g[i][j] = g[n - i + 1][j] = g[i][n - j + 1] = g[n - i + 1][n - j + 1] =
          num(4);
    }
  }
  if (n & 1) {
    k = 1;
    for (int i = 1; i <= n / 2; i++) {
      if (i != (n + 1) / 2) {
        g[i][(n + 1) / 2] = g[n - i + 1][(n + 1) / 2] = num(2);
        g[(n + 1) / 2][i] = g[(n + 1) / 2][n - i + 1] = num(2);
      }
    }
    k = 1;
    g[(n + 1) / 2][(n + 1) / 2] = num(1);
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cout << g[i][j] << " ";
    }
    cout << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
