#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) {
    long long n;
    cin >> n;
    long long a[n * n];
    for (long long int i = 0; i < n * n; i++) cin >> a[i];
    sort(a, a + n * n);
    if (n % 2 == 0) {
      bool flag = true;
      long long i = 0;
      while (i < n * n) {
        if (a[i] == a[i + 1] && a[i] == a[i + 2] && a[i] == a[i + 3]) {
          i += 4;
        } else {
          flag = false;
          break;
        }
      }
      if (flag == true) {
        cout << "YES" << '\n';
        long long b[n][n];
        long long cur = 0;
        for (long long int i = 0; i < n / 2; i++) {
          for (long long int j = 0; j < n / 2; j++) {
            b[i][j] = b[n - i - 1][j] = b[i][n - j - 1] =
                b[n - i - 1][n - j - 1] = a[cur];
            cur += 4;
          }
        }
        for (long long int i = 0; i < n; i++) {
          cout << b[i][0];
          for (long long int j = 1; j < n; j++) cout << " " << b[i][j];
          cout << '\n';
        }
      } else
        cout << "NO" << '\n';
    } else {
      bool flag = true;
      long long i = 0;
      long long x = 0, y = 0, z = 0;
      vector<long long int> v2;
      v2.clear();
      long long c = 0;
      while (i < n * n) {
        if (i < n * n - 3 && a[i] == a[i + 1] && a[i] == a[i + 2] &&
            a[i] == a[i + 3] && x < (n - 1) * (n - 1)) {
          x += 4;
          i += 4;
        } else if (i < n * n - 1 && a[i] == a[i + 1]) {
          v2.push_back(i);
          i += 2;
        } else {
          c = i;
          z++;
          i++;
        }
      }
      if (z == 1 && x == (n - 1) * (n - 1)) {
        cout << "YES" << '\n';
        long long b[n][n];
        long long cur = 0;
        long long t = 0;
        for (long long int i = 0; i < n / 2; i++) {
          for (long long int j = 0; j < n / 2; j++) {
            if (cur == c) cur++;
            while (t < v2.size() && cur == v2[t]) {
              cur += 2;
              t++;
            }
            if (cur == c) cur++;
            b[i][j] = b[n - i - 1][j] = b[i][n - j - 1] =
                b[n - i - 1][n - j - 1] = a[cur];
            cur += 4;
          }
        }
        t = 0;
        for (long long int i = 0; i < n / 2; i++) {
          b[i][n / 2] = b[n - i - 1][n / 2] = a[v2[t]];
          t++;
        }
        for (long long int i = 0; i < n / 2; i++) {
          b[n / 2][i] = b[n / 2][n - i - 1] = a[v2[t]];
          t++;
        }
        b[n / 2][n / 2] = a[c];
        for (long long int i = 0; i < n; i++) {
          cout << b[i][0];
          for (long long int j = 1; j < n; j++) cout << " " << b[i][j];
          cout << '\n';
        }
      } else
        cout << "NO" << '\n';
    }
  }
  return 0;
}
