#include <bits/stdc++.h>
int n, total;
int ans[20][20];
int cnt[1001];
int target_r, target_c;
void update(int num) {
  ans[target_r][target_c] = num;
  ans[target_r][n - 1 - target_c] = num;
  ans[n - 1 - target_r][target_c] = num;
  ans[n - 1 - target_r][n - 1 - target_c] = num;
  target_c++;
  if (target_c >= n / 2) {
    target_c = 0;
    target_r++;
  }
}
int main() {
  scanf("%d", &n);
  total = n * n;
  for (int i = 0; i < n * n; i++) {
    int input;
    scanf("%d", &input);
    cnt[input]++;
  }
  for (int i = 1; i <= 1000;) {
    while (cnt[i] >= 4 && target_r < n / 2 && target_c < n / 2) {
      update(i);
      cnt[i] -= 4;
      total -= 4;
    }
    i++;
  }
  if (n & 1) {
    target_c = 0;
    for (int i = 1; i <= 1000;) {
      while (cnt[i] >= 2 && target_c < n / 2) {
        ans[n / 2][target_c] = ans[n / 2][n - 1 - target_c] = i;
        target_c++;
        cnt[i] -= 2;
        total -= 2;
      }
      i++;
    }
    target_r = 0;
    for (int i = 1; i <= 1000;) {
      while (cnt[i] >= 2 && target_r < n / 2) {
        ans[target_r][n / 2] = ans[n - 1 - target_r][n / 2] = i;
        target_r++;
        cnt[i] -= 2;
        total -= 2;
      }
      i++;
    }
    for (int i = 1; i <= 1000; i++) {
      if (cnt[i]) {
        ans[n / 2][n / 2] = i;
        cnt[i]--;
        total--;
        break;
      }
    }
  }
  if (total == 0) {
    printf("YES\n");
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) printf("%d ", ans[i][j]);
      printf("\n");
    }
  } else
    printf("NO\n");
  return 0;
}
