#include <bits/stdc++.h>
using namespace std;
bool res[111][111];
int n;
bool print() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      printf("%d ", res[i][j]);
    }
    puts("");
  }
  return 0;
}
int main() {
  int k, i, j;
  scanf("%d %d", &n, &k);
  if (n * n < k) return !printf("-1");
  if (k == 0) return print();
  bool flag = 0;
  for (i = 0; i < n; i++) {
    for (j = i; j < n; j++) {
      if (i == j)
        --k, res[i][j] = 1;
      else
        k -= 2, res[i][j] = res[j][i] = 1;
      if (k <= 0) {
        flag = 1;
        break;
      }
    }
    if (flag) break;
  }
  if (k == 0)
    return print();
  else {
    res[i][j] = res[j][i] = 0;
    res[i + 1][i + 1] = 1;
    return print();
  }
  return 0;
}
