#include <bits/stdc++.h>
using namespace std;
map<long long int, long long int> m;
int main() {
  long long int n, cnt2 = 0, cnt4 = 0, cnt = 0;
  cin >> n;
  long long int a[n * n];
  long long int b[n + 1][n + 1];
  for (long long int i = 0; i < n * n; i++) {
    cin >> a[i];
    m[a[i]]++;
  }
  sort(a, a + n * n);
  for (long long int i = 0; i <= a[n * n - 1]; i++) {
    if (m[i] % 2 != 0 && m[i] != 0) {
      cnt++;
    }
    if (m[i] != 0) {
      long long int temp = m[i];
      cnt4 += temp / 4;
      temp -= (temp / 4) * 4;
      cnt2 += temp / 2;
    }
  }
  long long int temp = cnt4;
  if (cnt4 > (n / 2) * (n / 2)) {
    cnt4 = (n / 2) * (n / 2);
    temp -= (n / 2) * (n / 2);
    cnt2 += temp * 2;
  }
  if (n % 2 == 0 && (cnt != 0 || cnt4 != (n / 2) * (n / 2)))
    cout << "NO" << endl;
  else if (n % 2 != 0 &&
           (cnt != 1 || cnt4 != (n / 2) * (n / 2) || cnt2 != (n / 2) * 2))
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    for (long long int i = 1; i <= n / 2; i++) {
      for (long long int k = 1; k <= n / 2; k++) {
        for (long long int j = 0; j <= a[n * n - 1]; j++) {
          if (m[j] >= 4 && m[j] != 0) {
            b[i][k] = j;
            b[n - i + 1][k] = j;
            b[i][n - k + 1] = j;
            b[n - i + 1][n - k + 1] = j;
            m[j] -= 4;
            break;
          }
        }
      }
    }
    if (n % 2 != 0) {
      for (long long int j = 1; j <= n / 2; j++) {
        for (long long int i = 1; i <= a[n * n - 1]; i++) {
          if (m[i] >= 2) {
            b[n / 2 + 1][j] = i;
            b[n / 2 + 1][n - j + 1] = i;
            m[i] -= 2;
            break;
          }
        }
      }
      for (long long int j = 1; j <= n; j++) {
        for (long long int k = 1; k <= a[n * n - 1]; k++) {
          if (m[k] >= 2) {
            b[j][n / 2 + 1] = k;
            b[n - j + 1][n / 2 + 1] = k;
            m[k] -= 2;
            break;
          }
        }
      }
      for (long long int k = 0; k <= a[n * n - 1]; k++) {
        if (m[k] == 1) {
          b[n / 2 + 1][n / 2 + 1] = k;
          break;
        }
      }
    }
    for (long long int i = 1; i <= n; i++) {
      for (long long int j = 1; j <= n; j++) {
        cout << b[i][j] << " ";
      }
      cout << endl;
    }
  }
}
