#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
constexpr int MOD = 1e9 + 7;
constexpr int INF = INT_MAX;
constexpr ll LLINF = LLONG_MAX;
template <class T>
inline bool setmin(T &a, T b) {
  if (a > b) return a = b, 1;
  return 0;
}
template <class T>
inline bool setmax(T &a, T b) {
  if (a < b) return a = b, 1;
  return 0;
}
namespace vector_magic {
template <class T>
istream &operator>>(istream &os, vector<T> &container) {
  for (auto &u : container) os >> u;
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &container) {
  for (auto &u : container) os << u << " ";
  return os;
}
}  // namespace vector_magic
using namespace vector_magic;
namespace fastio {
template <typename... args>
void re(args &...tail) {
  ((cin >> tail), ...);
}
template <typename... args>
void pr(args... tail) {
  ((cout << tail << " "), ...);
}
template <typename... args>
void prln(args... tail) {
  ((cout << tail << " "), ...);
  cout << "\n";
}
}  // namespace fastio
using namespace fastio;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  re(n);
  vi ile(1001);
  vector<vi> res(n, vi(n));
  for (int i = (0); i <= (n * n - 1); i++) {
    int x;
    re(x);
    ile[x]++;
  }
  for (int _ile = (4); _ile >= (1); _ile--) {
    for (int i = (0); i <= (n - 1); i++) {
      for (int j = (0); j <= (n - 1); j++) {
        if (res[i][j]) {
          continue;
        }
        int temp = (i != (n - 1 - i));
        temp += (j != (n - 1 - j));
        temp += (i != (n - 1 - i) and (j != n - 1 - j));
        temp += 1;
        if (temp != _ile) {
          continue;
        }
        for (int k = (1); k <= (1000); k++) {
          if (ile[k] >= temp) {
            res[i][j] = res[n - 1 - i][j] = k;
            res[i][n - 1 - j] = res[n - 1 - i][n - 1 - j] = k;
            ile[k] -= temp;
            break;
          } else if (k == 1000) {
            prln("NO");
            exit(0);
          }
        }
      }
    }
  }
  prln("YES");
  for (auto &i : res) {
    prln(i);
  }
  exit(0);
}
