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