#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
int n, k;
bool a[110][110];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  if (n * n < k) return cout << -1, 0;
  for (int i = 1; i <= n; i++) {
    if (!k) break;
    for (int j = 1; j <= n; j++) {
      if (a[i][j]) continue;
      if (!k) break;
      if (i == j) {
        k--;
        a[i][i] = 1;
        continue;
      }
      if (k >= 2) {
        a[j][i] = 1;
        a[i][j] = 1;
        k -= 2;
      } else
        break;
    }
  }
  if (k)
    for (int i = 1; i <= n; i++)
      if (a[i][i] == 0) {
        k--;
        a[i][i] = 1;
        break;
      }
  if (k) return cout << -1, 0;
  for (int i = 1; i <= n; i++, cout << "\n")
    for (int j = 1; j <= n; j++) cout << a[i][j] << " ";
}
