#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
const int mod = 1e9 + 7;
int dcmp(long double x, long double y) {
  return fabs(x - y) <= 1e-10 ? 0 : x < y ? -1 : 1;
}
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
int n;
int frq[1001];
priority_queue<pair<int, int> > q;
vector<vector<int> > v;
int main() {
  fast();
  cin >> n;
  for (int i = 0; i < n * n; i++) {
    int x;
    cin >> x;
    frq[x]++;
  }
  for (int i = 1; i <= 1000; i++) {
    if (frq[i]) {
      q.push({frq[i], i});
    }
  }
  v.resize(n, vector<int>(n, 0));
  for (int r = 0; r < n / 2; r++) {
    if (r == n - r - 1) continue;
    for (int c = 0; c < n / 2; c++) {
      if (c == n - c - 1) continue;
      auto cur = q.top();
      q.pop();
      if (cur.first < 4) return cout << "NO\n", 0;
      v[r][c] = v[r][n - c - 1] = cur.second;
      cur.first -= 4;
      if (cur.first) q.push(cur);
    }
  }
  for (int r = 0; r <= n / 2; r++) {
    for (int c = 0; c <= n / 2; c++) {
      if (((c == n - c - 1) ^ (r == n - r - 1)) == 0) continue;
      auto cur = q.top();
      q.pop();
      if (cur.first < 2) return cout << "NO\n", 0;
      v[r][c] = v[r][n - c - 1] = cur.second;
      cur.first -= 2;
      if (cur.first) q.push(cur);
    }
  }
  for (int r = 0; r <= n / 2; r++) {
    for (int c = 0; c <= n / 2; c++) {
      if (((c == n - c - 1) && (r == n - r - 1)) == 0) continue;
      auto cur = q.top();
      q.pop();
      if (cur.first < 1) return cout << "NO\n", 0;
      v[r][c] = v[r][n - c - 1] = cur.second;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n / 2; i++) {
    v[n - i - 1] = v[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << v[i][j] << " ";
    }
    cout << '\n';
  }
  return 0;
}
