#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 10, mod = 1e9 + 7;
const double exp1 = 1e-8;
int n, m, k;
int f[N];
int s[N][N], h[N];
;
int sum, a, b, c;
int dp[N];
double mintime;
int main() {
  scanf("%d %d", &n, &k);
  if (n * n < k) {
    printf("-1\n");
    return 0;
  }
  int n1 = k;
  for (int i = 1; i <= n; i++) {
    if (n1 <= 0) break;
    if (n1 >= 2 * (n - i) + 1) {
      for (int j = i; j <= n; j++) {
        s[i][j] = 1;
        s[j][i] = 1;
      }
      n1 = n1 - (2 * (n - i) + 1);
    } else {
      if (n1 % 2 == 1) {
        for (int j = i; j <= n; j++) {
          if (n1 == -1) break;
          s[i][j] = 1;
          s[j][i] = 1;
          n1 -= 2;
        }
      } else {
        for (int j = i; j <= n; j++) {
          if (n1 == 0) break;
          s[i][j] = 1;
          s[j][i] = 1;
          n1 -= 2;
        }
        s[i + 1][i + 1] = 1;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%d", s[i][1]);
    for (int j = 2; j <= n; j++) {
      printf(" %d", s[i][j]);
    }
    printf("\n");
  }
  return 0;
}
