#include <bits/stdc++.h>
using namespace std;
const int maxn = 20;
int n = 0, m = 0;
map<int, int> mp;
int a[maxn + 10][maxn + 10];
int get_num(int cnt) {
  map<int, int>::iterator it = mp.begin();
  for (it = mp.begin(); it != mp.end(); ++it) {
    if (it->second >= cnt) {
      it->second -= cnt;
      return it->first;
    }
  }
  return -1;
}
void solve() {
  for (int i = 1; i <= n / 2; ++i) {
    for (int j = 1; j <= n / 2; ++j) {
      int num = get_num(4);
      if (num == -1) {
        printf("NO\n");
        return;
      }
      a[i][j] = a[n + 1 - i][j] = a[i][n + 1 - j] = a[n + 1 - i][n + 1 - j] =
          num;
    }
  }
  if (n & 1) {
    for (int i = 1; i <= n / 2; ++i) {
      int num = get_num(2);
      if (num == -1) {
        printf("NO\n");
        return;
      }
      a[i][(n + 1) / 2] = a[n + 1 - i][(n + 1) / 2] = num;
      num = get_num(2);
      if (num == -1) {
        printf("NO\n");
        return;
      }
      a[(n + 1) / 2][i] = a[(n + 1) / 2][n + 1 - i] = num;
    }
    int num = get_num(1);
    if (num == -1) {
      printf("NO\n");
      return;
    }
    a[(n + 1) / 2][(n + 1) / 2] = num;
  }
  printf("YES\n");
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      printf("%d%c", a[i][j], j == n ? '\n' : ' ');
    }
  }
}
int main() {
  while (~scanf("%d", &n)) {
    mp.clear();
    for (int i = 1; i <= n * n; ++i) {
      int x = 0;
      scanf("%d", &x);
      ++mp[x];
    }
    solve();
  }
  return 0;
}
