#include <bits/stdc++.h>
using namespace std;
int ans[25][25];
int n, a[500];
map<int, int> m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) {
    cin >> n;
    vector<long long int> v;
    for (long long int i = 0; i < n * n; i++) {
      cin >> a[i];
      if (m[a[i]] == 0) {
        v.push_back(a[i]);
      }
      m[a[i]] += 1;
    }
    if (n % 2 == 0) {
      for (auto u : v) {
        if (m[u] % 4 != 0) {
          cout << "NO";
          exit(0);
        }
      }
      for (long long int i = 0; i < n / 2; i++) {
        for (long long int j = 0; j < n / 2; j++) {
          if (ans[i][j] == 0) {
            for (auto k : v) {
              if (m[k] != 0) {
                ans[i][j] = k;
                ans[i][n - j - 1] = k;
                ans[n - i - 1][j] = k;
                ans[n - i - 1][n - j - 1] = k;
                m[k] -= 4;
                break;
              }
            }
          }
        }
      }
      cout << "YES" << '\n';
      for (long long int i = 0; i < n; i++) {
        for (long long int j = 0; j < n; j++) {
          cout << ans[i][j] << " ";
        }
        cout << '\n';
      }
    } else {
      if (n == 1) {
        cout << "YES" << '\n';
        cout << a[0] << '\n';
        exit(0);
      }
      int count_odd = 0;
      for (auto u : v)
        if (m[u] % 2) count_odd++;
      if (count_odd > 1) {
        cout << "NO" << '\n';
        exit(0);
      }
      for (long long int i = 0; i < n / 2; i++) {
        for (long long int j = 0; j < n / 2; j++) {
          if (ans[i][j] == 0) {
            for (auto k : v) {
              if (m[k] >= 4) {
                ans[i][j] = k;
                ans[i][n - j - 1] = k;
                ans[n - i - 1][j] = k;
                ans[n - i - 1][n - j - 1] = k;
                m[k] -= 4;
                break;
              }
            }
          }
        }
      }
      for (long long int i = 0; i < n / 2; i++) {
        for (long long int j = 0; j < n / 2; j++) {
          if (ans[i][j] == 0) {
            cout << "NO" << '\n';
            return 0;
          }
        }
      }
      for (long long int i = 0; i < n / 2; i++) {
        for (auto k : v) {
          if (m[k] >= 2) {
            ans[i][n / 2] = k;
            ans[n - i - 1][n / 2] = k;
            m[k] -= 2;
            break;
          }
        }
      }
      for (long long int i = 0; i < n / 2; i++) {
        for (auto k : v) {
          if (m[k] >= 2) {
            ans[n / 2][i] = k;
            ans[n / 2][n - i - 1] = k;
            m[k] -= 2;
            break;
          }
        }
      }
      for (auto u : v) {
        if (m[u] > 0) ans[n / 2][n / 2] = u;
      }
      cout << "YES" << '\n';
      for (long long int i = 0; i < n; i++) {
        for (long long int j = 0; j < n; j++) {
          cout << ans[i][j] << " ";
        }
        cout << '\n';
      }
    }
  }
  return 0;
}
