#include <bits/stdc++.h>   using namespace std;   using namespace chrono;   const int maxn = 1e6;   void solve() {     int n, a[21][21], val;     vector<int> data;     map<int, int> m;     cin >> n;     for (int i = 0; i < n * n; i++) {       cin >> val;       data.push_back(val);       m[val]++;     }     if (n == 1) {       cout <<  YES             <<   n ;       cout << data[0] <<   n ;       return;     }     for (int ii = 0; ii < n; ii++) {       for (int jj = 0; jj < n; jj++) {         a[ii][jj] = 0;       }     }     for (int ii = 0; ii < n / 2; ii++) {       for (int jj = 0; jj < n / 2; jj++) {         int v_f = 0, v_s = 0;         for (auto it = m.begin(); it != m.end(); it++) {           if (it->second >= 4) {             v_f = it->first;             break;           }         }         if (v_f == 0) {           cout <<  NO                 <<   n ;           return;         }         a[ii][jj] = v_f;         a[n - ii - 1][jj] = v_f;         a[ii][n - jj - 1] = v_f;         a[n - ii - 1][n - jj - 1] = v_f;         m[v_f] -= 4;       }     }     if ((n & 1) == 0) {       cout <<  YES             <<   n ;       for (int ii = 0; ii < n; ii++) {         for (int jj = 0; jj < n; jj++) {           cout << a[ii][jj] <<    ;         }         cout <<   n ;       }       cout <<   n ;       return;     }     for (int ii = 0; ii < n / 2; ii++) {       int f = 0;       for (auto it = m.begin(); it != m.end(); it++) {         if (it->second >= 2) {           f = it->first;         }       }       if (f == 0) {         cout <<  NO               <<   n ;         return;       }       a[ii][n / 2] = f;       a[n - ii - 1][n / 2] = f;       m[f] -= 2;     }     for (int ii = 0; ii < n / 2; ii++) {       int f = 0;       for (auto it = m.begin(); it != m.end(); it++) {         if (it->second >= 2) f = it->first;       }       if (f == 0) {         cout <<  NO               <<   n ;         return;       }       a[n / 2][ii] = f;       a[n / 2][n - ii - 1] = f;       m[f] -= 2;     }     int f = 0;     for (auto it = m.begin(); it != m.end(); it++) {       if (it->second == 1) {         f = it->first;       }     }     if ((n & 1) == 1) {       a[n / 2][n / 2] = f;     }     cout <<  YES           <<   n ;     for (int ii = 0; ii < n; ii++) {       for (int jj = 0; jj < n; jj++) {         cout << a[ii][jj] <<    ;       }       cout <<   n ;     }     cout <<   n ;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     solve();     return 0;   }   