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