#include <bits/stdc++.h>
using namespace std;
int mat[111][111];
int main() {
  int n, k, i, j;
  scanf("%d", &n);
  scanf("%d", &k);
  memset(mat, 0, sizeof(mat));
  if (k > n * n)
    cout << "-1" << endl;
  else {
    if (k != 0) {
      for (i = 0; i < n; i++) {
        if (k >= (2 * (n - i) - 1)) {
          for (j = i; j < n; j++) {
            mat[i][j] = 1;
            mat[j][i] = 1;
          }
          k = k - (2 * (n - i) - 1);
        } else {
          mat[i][i] = 1;
          k--;
          for (j = i + 1; j < n; j++) {
            if (k == 0) break;
            if (k == 1) {
              k--;
              mat[i + 1][i + 1] = 1;
              break;
            } else {
              mat[i][j] = 1;
              mat[j][i] = 1;
              k -= 2;
            }
          }
        }
        if (k == 0) break;
      }
    }
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) cout << mat[i][j] << " ";
      cout << endl;
    }
    cout << endl;
  }
  return 0;
}
