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