#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18 + 3;
const int N = 1e3 + 3;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
void solve() {
  int n;
  cin >> n;
  map<int, int> cnt;
  for (int i = 0; i < n * n; i++) {
    int x;
    cin >> x;
    cnt[x]++;
  }
  int a[n + 1][n + 1];
  int m = n * n;
  if (n & 1) {
    int n4 = (n / 2) * (n / 2);
    int n2 = n - 1;
    int n1 = 1;
    stack<int> s4, s2, s1;
    for (auto &x : cnt) {
      while (x.second >= 4 && n4) {
        x.second -= 4;
        s4.push(x.first);
        n4--;
      }
    }
    for (auto &x : cnt) {
      while (x.second >= 2 && n2) {
        x.second -= 2;
        s2.push(x.first);
        n2--;
      }
    }
    for (auto &x : cnt) {
      while (x.second >= 1 && n1) {
        x.second--;
        s1.push(x.first);
        n1--;
      }
    }
    if (n1 > 0 || n2 > 0 || n4 > 0) {
      cout << "NO";
      return;
    }
    for (int i = 1; i <= (n + 1) / 2; i++) {
      for (int j = 1; j <= (n + 1) / 2; j++) {
        int val;
        if (i == (n + 1) / 2 && j == (n + 1) / 2) {
          val = s1.top();
          s1.pop();
        } else if (i == (n + 1) / 2 || j == (n + 1) / 2) {
          val = s2.top();
          s2.pop();
        } else {
          val = s4.top();
          s4.pop();
        }
        int ir = n + 1 - i, jr = n + 1 - j;
        a[i][j] = a[ir][j] = a[i][jr] = a[ir][jr] = val;
      }
    }
  } else {
    int n4 = (n / 2) * (n / 2);
    stack<int> s4;
    for (auto &x : cnt) {
      while (x.second >= 4 && n4) {
        x.second -= 4;
        s4.push(x.first);
        n4--;
      }
    }
    if (n4 > 0) {
      cout << "NO";
      return;
    }
    for (int i = 1; i <= n / 2; i++) {
      for (int j = 1; j <= n / 2; j++) {
        int ir = n + 1 - i, jr = n + 1 - j;
        int val = s4.top();
        s4.pop();
        a[i][j] = a[ir][j] = a[i][jr] = a[ir][jr] = val;
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cout << a[i][j] << ' ';
    }
    cout << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
}
