#include <bits/stdc++.h>
using namespace std;
int const oo = 1e9, bound = 1e6 + 1, mod = 51123987;
long long const OO = 1e18;
int aa[100][100];
int main() {
  int n, k;
  cin >> n >> k;
  if (n * n < k) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (aa[i][j]) continue;
      if (i == j && k >= 1) {
        k--;
        aa[i][i] = 1;
      } else if (k >= 2) {
        k -= 2;
        aa[i][j] = 1;
        aa[j][i] = 1;
      }
    }
  }
  if (k) {
    cout << -1;
    return 0;
  }
  for (int(i) = 0; (i) < (n); (i)++) {
    for (int(j) = 0; (j) < (n); (j)++) {
      cout << aa[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
