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