#include <bits/stdc++.h>
using namespace std;
const int maxn = 100;
int n, k;
int res[maxn + 1][maxn + 1];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> k;
  if (n * n < k) {
    cout << -1;
    return 0;
  }
  memset(res, 0, sizeof(res));
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (res[i][j] == 0) {
        if (i != j and k > 1) {
          res[i][j] = 1;
          res[j][i] = 1;
          k -= 2;
        } else if (i == j and k > 0) {
          res[i][j] = 1;
          k--;
        }
      }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cout << res[i][j] << ' ';
    }
    cout << '\n';
  }
  return 0;
}
