#include <bits/stdc++.h>
using namespace std;
map<int, int> m;
map<int, int>::iterator it;
int give(int get) {
  for (it = m.begin(); it != m.end(); it++) {
    int val = it->second, i = it->first;
    if (val >= get) {
      val -= get;
      m[i] = val;
      return i;
    }
  }
  return -1;
}
int main() {
  int n;
  cin >> n;
  int arr[n + 1][n + 1];
  for (long long int i = 1; i <= n * n; i++) {
    int num;
    cin >> num;
    m[num]++;
  }
  for (long long int i = 1; i <= n / 2; i++) {
    for (long long int j = 1; j <= n / 2; j++) {
      int val = give(4);
      if (val == -1) {
        cout << "NO\n";
        return 0;
      }
      arr[i][j] = arr[i][n - j + 1] = arr[n - i + 1][j] =
          arr[n - i + 1][n - j + 1] = val;
    }
  }
  if (n % 2) {
    for (long long int i = 1; i <= n / 2; i++) {
      int val = give(2);
      if (val == -1) {
        cout << "NO\n";
        return 0;
      }
      arr[i][n / 2 + 1] = arr[n - i + 1][n / 2 + 1] = val;
    }
    for (long long int j = 1; j <= n / 2; j++) {
      int val = give(2);
      if (val == -1) {
        cout << "NO\n";
        return 0;
      }
      arr[n / 2 + 1][j] = arr[n / 2 + 1][n - j + 1] = val;
    }
    int val = give(1);
    if (val == -1) {
      cout << "NO\n";
      return 0;
    }
    arr[n / 2 + 1][n / 2 + 1] = val;
  }
  cout << "YES\n";
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = 1; j <= n; j++) {
      cout << arr[i][j] << " ";
    }
    cout << "\n";
  }
}
