#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n * n);
  map<int, int> mp;
  for (int i = 0; i < (int)(n * n); i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  priority_queue<pair<int, int>> que;
  for (auto it : mp) {
    pair<int, int> p = {it.second, it.first};
    que.push(p);
  }
  vector<vector<int>> ans(n, vector<int>(n));
  bool flag = true;
  for (int i = 0; i < n / 2; i++) {
    for (int j = 0; j < n / 2; j++) {
      pair<int, int> p = que.top();
      que.pop();
      if (p.first < 4) {
        flag = false;
        break;
      }
      p.first -= 4;
      ans[i][j] = p.second;
      ans[n - 1 - i][j] = p.second;
      ans[i][n - 1 - j] = p.second;
      ans[n - 1 - i][n - 1 - j] = p.second;
      if (p.first == 0) continue;
      que.emplace(p.first, p.second);
    }
    if (!flag) break;
  }
  if (n % 2 == 1) {
    for (int i = 0; i < n / 2; i++) {
      pair<int, int> p = que.top();
      que.pop();
      if (p.first < 2) {
        flag = false;
        break;
      }
      p.first -= 2;
      ans[i][n / 2] = p.second;
      ans[n - 1 - i][n / 2] = p.second;
      if (p.first == 0) continue;
      que.emplace(p.first, p.second);
    }
    for (int i = 0; i < n / 2; i++) {
      pair<int, int> p = que.top();
      que.pop();
      if (p.first < 2) {
        flag = false;
        break;
      }
      p.first -= 2;
      ans[n / 2][i] = p.second;
      ans[n / 2][n - 1 - i] = p.second;
      if (p.first == 0) continue;
      que.emplace(p.first, p.second);
    }
    if (flag) {
      ans[n / 2][n / 2] = que.top().second;
    }
  }
  if (flag) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (j == n - 1)
          cout << ans[i][j] << endl;
        else
          cout << ans[i][j] << " ";
      }
    }
  } else {
    cout << "NO" << endl;
  }
}
