#include <bits/stdc++.h>
using namespace std;
int n;
int k;
int a[200][200];
int main() {
  cin >> n >> k;
  if (k > n * n) {
    cout << -1;
    return 0;
  }
  int j = 0;
  if (k != 1) {
    for (int i = 1; i <= n; i++) {
      j = i;
      while ((k >= 2) && j <= n) {
        a[i][j] = 1;
        a[j][i] = 1;
        if (i == j) {
          k--;
        } else {
          k -= 2;
        }
        j++;
      }
      if (k <= 1) {
        j = i;
        break;
      }
    }
    if (k == 1) {
      a[j + 1][j + 1] = 1;
    }
  } else {
    a[1][1] = 1;
  }
  for (int i = 1; i <= n; i++) {
    for (int l = 1; l <= n; l++) {
      cout << a[i][l] << " ";
    }
    cout << endl;
  }
}
