#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> cnt(1001);
  for (int i = 0, tmp; i < n * n; ++i) {
    cin >> tmp;
    ++cnt[tmp];
  }
  multimap<int, int, greater<int>> m;
  for (int i = 1; i <= 1000; ++i) {
    if (cnt[i] > 0) {
      m.insert({cnt[i], i});
    }
  }
  vector<vector<int>> ans(n, vector<int>(n));
  auto check = [](int key) {
    if (key < 0) {
      cout << "NO\n";
      exit(0);
    }
  };
  for (int i = 0; i < n / 2; ++i) {
    for (int j = 0; j < n / 2; ++j) {
      auto it = m.begin();
      int key = it->first - 4;
      int val = it->second;
      check(key);
      ans[i][j] = val;
      ans[i][n - j - 1] = val;
      ans[n - i - 1][j] = val;
      ans[n - i - 1][n - j - 1] = val;
      m.erase(it);
      if (key > 0) {
        m.insert({key, val});
      }
    }
  }
  if (n & 1) {
    for (int i = 0; i < n / 2; ++i) {
      auto it = m.begin();
      int key = it->first - 2;
      int val = it->second;
      check(key);
      ans[n / 2][i] = val;
      ans[n / 2][n - i - 1] = val;
      m.erase(it);
      if (key > 0) {
        m.insert({key, val});
      }
    }
    for (int i = 0; i < n / 2; ++i) {
      auto it = m.begin();
      int key = it->first - 2;
      int val = it->second;
      check(key);
      ans[i][n / 2] = val;
      ans[n - i - 1][n / 2] = val;
      m.erase(it);
      if (key > 0) {
        m.insert({key, val});
      }
    }
    ans[n / 2][n / 2] = m.begin()->second;
  }
  cout << "YES\n";
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      cout << ans[i][j] << ' ';
    }
    cout << "\n";
  }
}
