#include <bits/stdc++.h>
using namespace std;
int value(int f[], int t) {
  for (int i = 1; i <= 1000; i++) {
    if (f[i] == t) {
      f[i] -= t;
      return i;
    }
  }
  for (int i = 1; i <= 1000; i++) {
    if (f[i] > t) {
      f[i] -= t;
      return i;
    }
  }
  return 0;
}
int main() {
  int n;
  cin >> n;
  int a[n * n + 1];
  int f[1001] = {0};
  for (int i = 1; i <= n * n; i++) {
    cin >> a[i];
    f[a[i]]++;
  }
  int ans[n + 1][n + 1];
  for (int j = 1; j <= (n + 1) / 2; j++) {
    for (int i = 1; i <= (n + 1) / 2; i++) {
      if (n % 2) {
        if (i == (n + 1) / 2) {
          if (j == (n + 1) / 2) {
            int x = value(f, 1);
            if (!x) {
              cout << "NO";
              return 0;
            } else
              ans[i][j] = x;
          } else {
            int x = value(f, 2);
            if (!x) {
              cout << "NO";
              return 0;
            } else
              ans[i][j] = ans[i][n + 1 - j] = x;
          }
        } else {
          if (j == (n + 1) / 2) {
            int x = value(f, 2);
            if (!x) {
              cout << "NO";
              return 0;
            } else
              ans[i][j] = ans[n + 1 - i][j] = x;
          } else {
            int x = value(f, 4);
            if (!x) {
              cout << "NO";
              return 0;
            } else
              ans[i][j] = ans[n + 1 - i][j] = ans[i][n + 1 - j] =
                  ans[n + 1 - i][n + 1 - j] = x;
          }
        }
      } else {
        int x = value(f, 4);
        if (!x) {
          cout << "NO";
          return 0;
        } else
          ans[i][j] = ans[n + 1 - i][j] = ans[i][n + 1 - j] =
              ans[n + 1 - i][n + 1 - j] = x;
      }
    }
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) cout << ans[i][j] << " ";
    cout << '\n';
  }
  return 0;
}
