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