#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
int main(int argc, char* argv[]) {
  std::ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  int n;
  cin >> n;
  auto a = vector<int>(n * n);
  for (int i = 0; i < (n * n); ++i) cin >> a[i];
  map<int, int> counts;
  for (auto e : a) counts[e] = (counts.count(e) ? counts[e] : 0) + 1;
  auto needed_fours = !(n % 2) ? n * n / 4 : (n - 1) * (n - 1) / 4;
  auto needed_twos = !(n % 2) ? 0 : (n - 1);
  auto needed_ones = n % 2;
  vector<int> fours, twos, ones;
  for (auto p : counts) {
    while (needed_fours > 0 && p.second >= 4) {
      fours.emplace_back(p.first);
      needed_fours--;
      p.second -= 4;
    }
    while (needed_twos > 0 && p.second >= 2) {
      twos.emplace_back(p.first);
      needed_twos--;
      p.second -= 2;
    }
    while (p.second > 0) {
      ones.emplace_back(p.first);
      needed_ones--;
      p.second -= 1;
    }
  }
  if (needed_fours != 0 || needed_twos != 0 || needed_ones != 0) {
    cout << "NO" << '\n';
    return 0;
  }
  cout << "YES" << '\n';
  int M[n][n];
  for (int i = 0; i < n / 2; ++i)
    for (int j = 0; j < n / 2; ++j) {
      M[i][j] = M[n - i - 1][j] = M[i][n - j - 1] = M[n - i - 1][n - j - 1] =
          fours.back();
      fours.pop_back();
    }
  if (n % 2) {
    for (int i = 0; i < n / 2; ++i) {
      M[n / 2][i] = M[n / 2][n - i - 1] = twos.back();
      twos.pop_back();
      M[i][n / 2] = M[n - i - 1][n / 2] = twos.back();
      twos.pop_back();
    }
    M[n / 2][n / 2] = ones.back();
  }
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (n); ++j) cout << M[i][j] << ' ';
    cout << '\n';
  }
  return 0;
}
