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