#include <bits/stdc++.h>
using namespace std;
int n, k, row, col, a[501][501];
int main() {
  cin >> n >> k;
  if (k > n * n) return cout << -1, 0;
  while (k) {
    a[++row][++col] = 1;
    --k;
    int j = row + 1;
    while (k >= 2) {
      a[row][j] = 1;
      a[j][col] = 1;
      k -= 2;
      ++j;
      if (j > n) break;
    }
  }
  for (int i = 1; i <= n; cout << endl, ++i)
    for (int j = 1; j <= n; j++) cout << a[i][j] << " ";
}
