#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 10;
int n;
set<int> st, oo;
int a[1005] = {};
int answer[25][25] = {};
int main() {
  ios::sync_with_stdio(0), ios_base::sync_with_stdio(0), cin.tie(0),
      cout.tie(0);
  ;
  cin >> n;
  for (int i = 1; i <= (int)n * n; ++i) {
    int x;
    cin >> x;
    a[x]++;
    st.insert(x);
  }
  if (n % 2 == 0) {
    for (auto u : st)
      if (a[u] % 4 != 0)
        return cout << "NO"
                    << "\n",
               0;
    for (int i = 1; i <= (int)n / 2; ++i) {
      for (int j = 1; j <= (int)n / 2; ++j) {
        if (a[*st.begin()]) {
          int z = *st.begin();
          a[z] -= 4;
          if (!a[z]) st.erase(z);
          answer[i][j] = answer[n - i + 1][j] = answer[i][n - j + 1] =
              answer[n - i + 1][n - j + 1] = z;
        }
      }
    }
  } else {
    for (int i = 1; i <= (int)n / 2; ++i) {
      for (int j = 1; j <= (int)n / 2; ++j) {
        while (a[*st.begin()] < 4) {
          oo.insert(*st.begin());
          st.erase(*st.begin());
          if (!st.size()) break;
        }
        if (!st.size())
          return cout << "NO"
                      << "\n",
                 0;
        if (a[*st.begin()]) {
          int z = *st.begin();
          a[z] -= 4;
          if (!a[z]) st.erase(z);
          answer[i][j] = answer[n - i + 1][j] = answer[i][n - j + 1] =
              answer[n - i + 1][n - j + 1] = z;
        }
      }
    }
    for (auto u : st) oo.insert(u);
    st.clear();
    int center = -1;
    for (int i = 1; i <= (int)n / 2; ++i) {
      while (a[*oo.begin()] < 2) {
        center = *oo.begin();
        oo.erase(*oo.begin());
        if (!oo.size()) break;
      }
      if (!oo.size())
        return cout << "NO"
                    << "\n",
               0;
      if (a[*oo.begin()]) {
        int z = *oo.begin();
        a[z] -= 2;
        if (!a[z]) oo.erase(z);
        answer[i][(n + 1) / 2] = answer[n - i + 1][(n + 1) / 2] = z;
      }
    }
    for (int i = 1; i <= (int)n / 2; ++i) {
      while (a[*oo.begin()] < 2) {
        center = *oo.begin();
        oo.erase(*oo.begin());
        if (!oo.size()) break;
      }
      if (!oo.size())
        return cout << "NO"
                    << "\n",
               0;
      if (a[*oo.begin()]) {
        int z = *oo.begin();
        a[z] -= 2;
        if (!a[z]) oo.erase(z);
        answer[(n + 1) / 2][i] = answer[(n + 1) / 2][n - i + 1] = z;
      }
    }
    if (center != -1)
      answer[(n + 1) / 2][(n + 1) / 2] = center;
    else if (!oo.size())
      return cout << "NO"
                  << "\n",
             0;
    else
      answer[(n + 1) / 2][(n + 1) / 2] = *oo.begin();
  }
  cout << "YES\n";
  for (int i = 1; i <= (int)n; ++i) {
    for (int j = 1; j <= (int)n; ++j) cout << answer[i][j] << " ";
    cout << "\n";
  }
  return 0;
}
