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