#include <bits/stdc++.h>
using namespace std;
int x[1500], a[30][30];
int main() {
  int n;
  cin >> n;
  bool f = 0;
  for (int i = 0; i < n * n; i++) {
    int b;
    cin >> b;
    x[b]++;
  }
  for (int i = 1; i <= n / 2; i++) {
    for (int j = 1; j <= n / 2; j++) {
      f = 0;
      for (int k = 1; k <= 1000; k++) {
        if (x[k] >= 4) {
          a[i][j] = a[i][n - j + 1] = a[n - i + 1][j] =
              a[n - i + 1][n - j + 1] = k;
          f = 1;
          x[k] -= 4;
          break;
        }
      }
    }
  }
  if (n % 2) {
    for (int i = 1; i <= n / 2; i++) {
      for (int j = 1; j <= 1000; j++) {
        if (x[j] >= 2) {
          a[i][n / 2 + 1] = a[n - i + 1][n / 2 + 1] = j;
          x[j] -= 2;
          break;
        }
      }
    }
    for (int i = 1; i <= n / 2; i++) {
      for (int j = 1; j <= 1000; j++) {
        if (x[j] >= 2) {
          a[n / 2 + 1][i] = a[n / 2 + 1][n - i + 1] = j;
          x[j] -= 2;
          break;
        }
      }
    }
    for (int i = 1; i <= 1000; i++) {
      if (x[i] >= 1) {
        a[n / 2 + 1][n / 2 + 1] = i;
        x[i]--;
        break;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (!a[i][j]) return cout << "NO", 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cout << a[i][j] << " ";
    }
    cout << endl;
  }
}
