#include <bits/stdc++.h>
using namespace std;
int a[105][105];
int main() {
  int n, k, i, j, p, q, cnt;
  scanf("%d%d", &n, &k);
  if (k > n * n) {
    printf("-1\n");
    return 0;
  }
  cnt = 0;
  for (i = 1; i <= n; i++)
    for (j = i; j <= n; j++) {
      if (i == j) {
        if (cnt + 1 <= k) {
          a[i][j] = 1;
          cnt++;
        }
      } else {
        if (cnt + 2 <= k) {
          a[i][j] = 1;
          a[j][i] = 1;
          cnt += 2;
        }
      }
      if (cnt == k) {
        for (p = 1; p <= n; p++) {
          for (q = 1; q <= n; q++) printf("%d ", a[p][q]);
          printf("\n");
        }
        return 0;
      }
    }
}
