#include <bits/stdc++.h>
using namespace std;
int grid[20][20];
map<int, int> counts;
int N = 0;
auto iter = counts.begin();
int odd = 0;
bool check() {
  if (N % 2 == 0) {
    for (auto a : counts)
      if (a.second < 4 || a.second % 2 == 1) return false;
    return true;
  } else {
    int num_odd = 0;
    for (auto a : counts) {
      if (a.second % 2 == 1) {
        num_odd++;
        odd = a.first;
      }
    }
    if (num_odd > 1)
      return false;
    else
      return true;
  }
}
bool can_place() {
  for (auto a : counts)
    if (a.second >= 4) return true;
  return false;
}
bool check_grid() {
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++)
      if (grid[i][j] == 0) return false;
  return true;
}
void fill_grid(int r, int c) {
  if (!can_place()) return;
  if (iter == counts.end()) iter = counts.begin();
  if (N - c - 1 <= c) return;
  if (iter->second == 0) iter = counts.erase(iter);
  if (N - r - 1 <= r)
    fill_grid(0, c + 1);
  else if (iter->second >= 4) {
    int val = iter->first;
    iter->second -= 4;
    grid[r][c] = val;
    grid[r][N - c - 1] = val;
    grid[N - r - 1][c] = val;
    grid[N - r - 1][N - c - 1] = val;
    fill_grid(r + 1, c);
  } else {
    iter++;
    fill_grid(r, c);
  }
}
int count_cands() {
  int num = 0;
  for (auto a : counts)
    if (a.second >= 2) num++;
  return num;
}
void fill_cross(bool c) {
  int count = count_cands();
  int i = 0, mid = N / 2;
  while (i != mid) {
    if (count == 0) return;
    if (iter == counts.end()) iter = counts.begin();
    if (iter->second < 2) {
      iter++;
      continue;
    }
    iter->second -= 2;
    if (iter->second < 2) count--;
    int val = iter->first;
    if (!c) {
      grid[i][mid] = val;
      grid[N - i - 1][mid] = val;
    } else {
      grid[mid][i] = val;
      grid[mid][N - i - 1] = val;
    }
    if (iter->second == 0) iter = counts.erase(iter);
    i++;
  }
}
void fill_cross() {
  fill_cross(true);
  fill_cross(false);
}
int main() {
  cin >> N;
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++) grid[i][j] = 0;
  int test = 0;
  for (int i = 0; i < N * N; i++) {
    cin >> test;
    counts[test]++;
  }
  iter = counts.begin();
  if (N == 1) {
    cout << "YES" << endl;
    cout << iter->first << endl;
  } else {
    if (!check())
      cout << "NO" << endl;
    else {
      fill_grid(0, 0);
      if (N % 2 == 1) fill_cross();
      if (N % 2 == 1) grid[N / 2][N / 2] = odd;
      if (!check_grid())
        cout << "NO" << endl;
      else {
        cout << "YES" << endl;
        for (int i = 0; i < N; i++) {
          for (int j = 0; j < N; j++) {
            cout << grid[i][j] << " ";
          }
          cout << endl;
        }
      }
    }
  }
  return 0;
}
