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