#include <bits/stdc++.h>
using std::map;
using std::queue;
using std::set;
using std::string;
using std::vector;
const int kMax = 1000;
const int kInf = INT32_MAX;
const double kEps = 10e-8;
template <typename T>
T read() {
  T var;
  std::cin >> var;
  return var;
}
int main() {
  const int n = read<int>();
  map<int, int> F;
  for (int counter = n * n; counter >= 1; counter--) {
    const int x = read<int>();
    F[x]++;
  }
  vector<queue<int>> groups(5);
  for (auto e : F) {
    int q = e.second;
    while (q >= 4) {
      groups[4].push(e.first);
      q -= 4;
    }
    while (q >= 2) {
      groups[2].push(e.first);
      q -= 2;
    }
    while (q >= 1) {
      groups[1].push(e.first);
      q -= 1;
    }
  }
  vector<vector<int>> M(n, vector<int>(n));
  int left = 0;
  int right = n - 1;
  bool isPossible = true;
  while (left <= right && isPossible) {
    int bottom = 0;
    ;
    int top = n - 1;
    set<std::pair<int, int>> cells;
    while (bottom <= top) {
      cells.insert({left, bottom});
      cells.insert({left, top});
      cells.insert({right, bottom});
      cells.insert({right, top});
      int size = cells.size();
      int v = -1;
      if (groups[size].empty()) {
        if (size == 1) {
          isPossible = false;
          break;
        } else if (size == 2) {
          if (groups[4].empty()) {
            isPossible = false;
            break;
          }
          v = groups[4].front();
          groups[4].pop();
          groups[2].push(v);
        } else {
          isPossible = false;
          break;
        }
      } else {
        v = groups[size].front();
        groups[size].pop();
      }
      M[left][bottom] = v;
      M[left][top] = v;
      M[right][bottom] = v;
      M[right][top] = v;
      bottom++;
      top--;
      cells.clear();
    }
    left++;
    right--;
  }
  if (isPossible) {
    std::cout << "YES\n";
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        std::cout << M[i][j] << " ";
      }
      std::cout << "\n";
    }
  } else {
    std::cout << "NO\n";
  }
  return EXIT_SUCCESS;
}
