#include <bits/stdc++.h>
using namespace std;
long long int n, m;
long long int arr[1000000];
array<long long int, 2> dp[1000000];
string st, tt;
long long int ans[30][30];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int TESTS, q, a, s, b, r, k, c, p, w, d, x, j, y, z, xs, ys, t;
  TESTS = 1;
  memset(arr, 0, sizeof(arr));
  while (TESTS--) {
    cin >> n;
    for (long long int i = 0; i <= n * n - 1; i++) {
      cin >> a;
      arr[a]++;
    }
    for (long long int i = 0; i <= (n + 1) / 2 - 1; i++) {
      for (long long int j = 0; j <= (n + 1) / 2 - 1; j++) {
        set<array<long long int, 2> > inds;
        inds.insert({i, j});
        inds.insert({n - 1 - i, j});
        inds.insert({i, n - 1 - j});
        inds.insert({n - 1 - i, n - 1 - j});
        bool fou = false;
        vector<array<long long int, 2> > nums;
        for (long long int k = 1; k <= 1000; k++) {
          if (arr[k] >= inds.size()) {
            nums.push_back({arr[k], k});
            fou = true;
          }
        }
        if (!nums.empty()) sort(nums.begin(), nums.end());
        if (!fou) {
          cout << "NO";
          return 0;
        } else {
          for (auto it : inds) ans[it[0]][it[1]] = nums[0][1];
          arr[nums[0][1]] -= inds.size();
        }
      }
    }
    cout << "YES\n";
    for (long long int i = 0; i <= n - 1; i++) {
      for (long long int j = 0; j <= n - 1; j++) cout << ans[i][j] << " ";
      cout << "\n";
    }
  }
  return 0;
}
