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