#include <bits/stdc++.h>
int main() {
  unsigned long int n, k, k2;
  std::cin >> n;
  std::cin >> k;
  k2 = k;
  int a[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      a[i][j] = 0;
    }
  }
  if (k > n * n) {
    std::cout << -1;
    return 0;
  } else {
    for (int i = 0; i < n; i++) {
      for (int j = i; j < n; j++) {
        if (k != 0) {
          if (i == j) {
            k--;
            a[i][j] = 1;
          } else if (k >= 2) {
            k -= 2;
            a[i][j] = 1;
            a[j][i] = 1;
          }
        }
      }
    }
  }
  if (k > 0) {
    std::cout << -1;
  } else {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        std::cout << a[i][j] << " ";
      }
      std::cout << std::endl;
    }
  }
  return 0;
}
