#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll LINF = 1001002003004005006ll;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<ll> a(n * n);
  map<ll, int> cnt;
  for (int i = 0; i < (n * n); i++) {
    cin >> a[i];
    cnt[a[i]]++;
  }
  if (n % 2) {
    ll ans[n][n];
    {
      int i = 0, j = 0;
      for (auto p : cnt) {
        while (p.second >= 4 and i < n / 2 and j < n / 2) {
          p.second -= 4;
          ans[i][j] = p.first;
          ans[n - 1 - i][j] = p.first;
          ans[n - 1 - i][n - 1 - j] = p.first;
          ans[i][n - 1 - j] = p.first;
          j++;
          if (j == n / 2) j = 0, i++;
        }
        cnt[p.first] = p.second;
        if (i == n / 2) break;
      }
      if (i != n / 2) {
        cout << "NO" << endl;
        return 0;
      }
    }
    {
      int i = 0, j = n / 2;
      for (auto p : cnt) {
        while (p.second >= 2 and i < n / 2) {
          p.second -= 2;
          ans[i][j] = p.first;
          ans[n - 1 - i][j] = p.first;
          i++;
        }
        cnt[p.first] = p.second;
        if (i == n / 2) break;
      }
      if (i != n / 2) {
        cout << "NO" << endl;
        return 0;
      }
    }
    {
      int i = n / 2, j = 0;
      for (auto p : cnt) {
        while (p.second >= 2 and j < n / 2) {
          p.second -= 2;
          ans[i][j] = p.first;
          ans[i][n - 1 - j] = p.first;
          j++;
        }
        cnt[p.first] = p.second;
        if (j == n / 2) break;
      }
      if (j != n / 2) {
        cout << "NO" << endl;
        return 0;
      }
    }
    for (auto p : cnt) {
      if (p.second) ans[n / 2][n / 2] = p.first;
    }
    cout << "YES" << endl;
    for (int i = 0; i < (n); i++) {
      for (int j = 0; j < (n); j++) {
        cout << ans[i][j] << (j + 1 == n ? "\n" : " ");
      }
    }
  } else {
    for (auto p : cnt) {
      if (p.second % 4) {
        cout << "NO" << endl;
        return 0;
      }
    }
    cout << "YES" << endl;
    ll ans[n][n];
    {
      int i = 0, j = 0;
      for (auto p : cnt) {
        while (p.second) {
          ans[i][j] = p.first;
          ans[n - 1 - i][j] = p.first;
          ans[n - 1 - i][n - 1 - j] = p.first;
          ans[i][n - 1 - j] = p.first;
          p.second -= 4;
          j++;
          if (j == n / 2) i++, j = 0;
        }
      }
    }
    for (int i = 0; i < (n); i++) {
      for (int j = 0; j < (n); j++) {
        cout << ans[i][j] << (j + 1 == n ? "\n" : " ");
      }
    }
  }
  return 0;
}
