#include <bits/stdc++.h>
using namespace std;
int a[101][101];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      a[i][j] = 0;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++)
      if (a[i][j] == 0) {
        if (k > 1) {
          a[i][j] = a[j][i] = 1;
          if (i != j)
            k -= 2;
          else
            k--;
        } else if (k == 1 && i == j) {
          a[i][j] = a[j][i] = 1;
          k--;
        }
      }
  }
  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];
        if (j < n - 1)
          cout << " ";
        else
          cout << endl;
      }
    }
  }
  return 0;
}
