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