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