#include <bits/stdc++.h>
using namespace std;
long long n, k;
long long m[102][102];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  if (k > n * n) {
    cout << "-1\n";
    return 0;
  }
  bool ok = false;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (k < 0) {
        cout << "-1\n";
        return 0;
      }
      if (k == 0) {
        ok = true;
        break;
      }
      if (i == j)
        m[i][j] = 1, k--;
      else if (!m[i][j] && i != j && k >= 2) {
        m[i][j] = 1;
        m[j][i] = 1;
        k -= 2;
      }
    }
    if (ok) break;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << m[i][j] << " ";
    }
    cout << "\n";
  }
}
