#include <bits/stdc++.h>
using namespace std;
int arr[102][102];
void output(int n) {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) cout << arr[i][j] << " ";
    cout << endl;
  }
}
void diagonalArrangement(int n, int &t) {
  for (int i = 0; i < n; i++) {
    if (t == 0) break;
    arr[i][i] = 1;
    t--;
  }
}
void remainingArrangement(int n, int &t) {
  for (int i = 0; i < n; i++) {
    if (t == 0) break;
    for (int j = 0; j < n; j++) {
      if (t == 0) break;
      if (i != j) {
        arr[i][j] = 1;
        arr[j][i] = 1;
        t -= 2;
      }
    }
  }
}
void totalArrangement(int n, int k) {
  for (int i = 0; i < n; i++) {
    if (k == 0) break;
    arr[i][i] = 1;
    k--;
    for (int j = 0; j < n; j++) {
      if (k == 0 || k < 2) break;
      if (i != j && arr[i][j] == 0) {
        arr[i][j] = 1;
        arr[j][i] = 1;
        k -= 2;
      }
    }
  }
}
void rightResult(int n, int k) {
  totalArrangement(n, k);
  output(n);
}
int main(void) {
  int n, k;
  cin >> n >> k;
  memset(arr, 0, sizeof(arr));
  if (k > n * n)
    cout << -1 << endl;
  else
    rightResult(n, k);
  return 0;
}
