#include <bits/stdc++.h>
using namespace std;
int n, cnt[2015], cur, ans[55][55];
int get(int x) {
  for (int i = 1; i <= 2000; i++)
    if (cnt[i] >= x) {
      cnt[i] -= x;
      return i;
    }
  return -1;
}
int solve() {
  for (int i = 1; i <= n / 2; i++) {
    for (int j = 1; j <= n / 2; j++) {
      int ti = n - i + 1, tj = n - j + 1;
      int val = get(4);
      if (val == -1) return -1;
      ans[i][j] = ans[ti][j] = ans[i][tj] = ans[ti][tj] = val;
    }
  }
  if (n % 2 == 0) return 1;
  for (int i = 1; i <= n / 2; i++) {
    int val = get(2);
    if (val == -1) return -1;
    ans[i][(n + 1) / 2] = ans[n - i + 1][(n + 1) / 2] = val;
    val = get(2);
    if (val == -1) return -1;
    ans[(n + 1) / 2][i] = ans[(n + 1) / 2][n - i + 1] = val;
  }
  int val = get(1);
  if (val == -1) return -1;
  ans[(n + 1) / 2][(n + 1) / 2] = val;
  return 1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  cur = 1;
  for (int i = 1; i <= n * n; i++) {
    int x;
    cin >> x;
    cnt[x]++;
  }
  if (solve() == -1)
    cout << "NO";
  else {
    cout << "YES\n";
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) cout << ans[i][j] << ' ';
      cout << endl;
    }
  }
  return 0;
}
