#include <bits/stdc++.h>
using namespace std;
const int nmax = 111;
int n, k, a[nmax][nmax];
int main() {
  cin >> n >> k;
  if (k > n * n) {
    cout << -1;
    return 0;
  }
  if (n == 1) {
    cout << k;
    return 0;
  }
  for (int i = 1; i <= n; ++i)
    if (k) {
      a[i][i] = 1;
      --k;
      for (int j = i + 1; j <= n; ++j)
        if (k > 1) {
          a[i][j] = a[j][i] = 1;
          k -= 2;
        }
    }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) cout << a[i][j] << " ";
    cout << endl;
  }
}
