#include <bits/stdc++.h>
int mat[100][100];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  if (k > n * n) {
    printf("-1\n");
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (k == 0) break;
    mat[i][i] = 1;
    k--;
    int j = 1;
    while (k >= 2) {
      if (i + j > n - 1) break;
      mat[i][i + j] = 1;
      mat[i + j][i] = 1;
      k -= 2;
      j++;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      printf("%d ", mat[i][j]);
    }
    printf("\n");
  }
}
