#include <bits/stdc++.h>
#pragma GCC optimize("O3", "unroll-loops")
using namespace std;
template <class T, class U>
inline void checkmin(T &x, U y) {
  if (y < x) x = y;
}
template <class T, class U>
inline void checkmax(T &x, U y) {
  if (y > x) x = y;
}
template <class T, class U>
inline bool ifmin(T &x, U y) {
  if (y < x) return x = y, true;
  return false;
}
template <class T, class U>
inline bool ifmax(T &x, U y) {
  if (y > x) return x = y, true;
  return false;
}
template <class T>
inline void sort(T &a) {
  sort(a.begin(), a.end());
}
template <class T>
inline void rsort(T &a) {
  sort(a.rbegin(), a.rend());
}
template <class T>
inline void reverse(T &a) {
  reverse(a.begin(), a.end());
}
template <class T>
inline istream &operator>>(istream &stream, vector<T> &a) {
  for (auto &i : a) stream >> i;
  return stream;
}
void ex() {
  cout << "NO";
  exit(0);
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(15);
  srand(85453532);
  long long n;
  cin >> n;
  vector<long long> arr(n * n);
  cin >> arr;
  map<long long, long long> cnt;
  for (auto i : arr) cnt[i]++;
  set<pair<int, int>> st;
  vector<vector<long long>> ans(n, vector<long long>(n));
  for (auto i : cnt) st.insert({i.second, i.first});
  for (int i = 0; i < n / 2; ++i)
    for (int j = 0; j < n / 2; ++j) {
      pair<int, int> b = *(--st.end());
      st.erase(b);
      if (b.first < 4) ex();
      ans[i][j] = ans[n - i - 1][j] = ans[i][n - 1 - j] =
          ans[n - 1 - i][n - 1 - j] = b.second;
      b.first -= 4;
      if (b.first) st.insert(b);
    }
  if (n & 1) {
    for (int i = 0; i < n / 2; ++i) {
      pair<int, int> b = *(--st.end());
      st.erase(b);
      if (b.first < 2) ex();
      ans[i][n >> 1] = ans[n - i - 1][n >> 1] = b.second;
      b.first -= 2;
      if (b.first) st.insert(b);
    }
    for (int i = 0; i < n / 2; ++i) {
      pair<int, int> b = *(--st.end());
      st.erase(b);
      if (b.first < 2) ex();
      ans[n >> 1][i] = ans[n >> 1][n - i - 1] = b.second;
      b.first -= 2;
      if (b.first) st.insert(b);
    }
    ans[n >> 1][n >> 1] = st.begin()->second;
  }
  cout << "YES\n";
  for (auto i : ans) {
    for (auto j : i) cout << j << ' ';
    cout << '\n';
  }
  return 0;
}
