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