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