#include <bits/stdc++.h>
using namespace std;
long long int g[5000][5000] = {0};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t, n, m, q, i, j, k, x, y, z, a, b;
  cin >> n >> x >> y;
  if (x > 1 && y > 1) {
    cout << "NO\n";
    return 0;
  } else if (x == 1 && y == 1 && n < 4 && n > 1) {
    cout << "NO\n";
    return 0;
  } else
    cout << "YES\n";
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) g[i][j] = 1;
  }
  for (i = 1; i < n; i++) {
    g[i][i + 1] = 0;
    g[i + 1][i] = 0;
    g[i][i] = 0;
  }
  g[n][n] = 0;
  m = 1;
  if (x == 1) {
    while (m != y) {
      g[m][m + 1] = 1;
      g[m + 1][m] = 1;
      m++;
    }
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++) cout << g[i][j];
      cout << "\n";
    }
  } else if (y == 1) {
    while (m != x) {
      g[m][m + 1] = 1;
      g[m + 1][m] = 1;
      m++;
    }
    for (i = 1; i <= n; i++) {
      g[i][i] = 1;
      for (j = 1; j <= n; j++) {
        cout << !g[i][j];
      }
      cout << "\n";
    }
  }
}
