#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 200100;
const long long INF = 2000000100;
const long long MOD = 998244353;
int N, N2;
int num[410];
int ans[22][22];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> N;
  N2 = N * N;
  for (int i = 0; i < N2; i++) {
    cin >> num[i];
  }
  sort(num, num + N2);
  vector<pair<long long, long long> > cnt;
  cnt.push_back(pair<long long, long long>(num[0], 1));
  for (int i = 1; i < N2; i++) {
    if (num[i] != num[i - 1]) {
      cnt.push_back(pair<long long, long long>(num[i], 1));
    } else {
      cnt[(int)cnt.size() - 1].second++;
    }
  }
  int x = 0, y = 0;
  if (N % 2 == 0) {
    for (int i = 0; i < (int)cnt.size(); i++) {
      if (cnt[i].second % 4 != 0) {
        cout << "NO\n";
        return 0;
      }
      while (cnt[i].second > 0) {
        ans[x][y] = ans[N - 1 - x][y] = ans[x][N - 1 - y] =
            ans[N - 1 - x][N - 1 - y] = cnt[i].first;
        cnt[i].second -= 4;
        x++;
        if (x == N / 2) x = 0, y++;
      }
    }
  } else {
    int vbar = 0;
    int hbar = 0;
    bool cent = 0;
    for (int i = 0; i < (int)cnt.size(); i++) {
      while (cnt[i].second >= 4 && y != N / 2) {
        ans[x][y] = ans[N - 1 - x][y] = ans[x][N - 1 - y] =
            ans[N - 1 - x][N - 1 - y] = cnt[i].first;
        cnt[i].second -= 4;
        x++;
        if (x == N / 2) x = 0, y++;
      }
      while (cnt[i].second >= 2 && vbar != N / 2) {
        ans[N / 2][vbar] = ans[N / 2][N - 1 - vbar] = cnt[i].first;
        cnt[i].second -= 2;
        vbar++;
      }
      while (cnt[i].second >= 2 && hbar != N / 2) {
        ans[hbar][N / 2] = ans[N - 1 - hbar][N / 2] = cnt[i].first;
        cnt[i].second -= 2;
        hbar++;
      }
      while (cnt[i].second >= 1 && !cent) {
        ans[N / 2][N / 2] = cnt[i].first;
        cnt[i].second--;
        cent = 1;
      }
      if (cnt[i].second > 0) {
        cout << "NO\n";
        return 0;
      }
    }
  }
  cout << "YES\n";
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      cout << (j != 0 ? " " : "") << ans[j][i];
    }
    cout << "\n";
  }
}
