#include <bits/stdc++.h>
using namespace std;
int a[106][107];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i)
    for (int j = i; j <= n; ++j) {
      if (k == 0) break;
      if (i == j)
        a[i][j] = 1, k--;
      else if (k > 1)
        a[i][j] = a[j][i] = 1, k -= 2;
    }
  if (k != 0)
    cout << -1;
  else {
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j) cout << a[i][j] << ' ';
      cout << '\n';
    }
  }
  return 0;
}
