#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, c = 1;
  bool arr[100][100];
  cin >> n >> k;
  if (k > n * n) {
    cout << "-1" << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) arr[i][j] = false;
  }
  for (int i = 0; i < n; i++) {
    for (int j = i; j < n; j++) {
      if (k > 0) {
        if (j == i) {
          arr[i][j] = true;
          k--;
        } else if (k >= 2) {
          arr[i][j] = true;
          arr[j][i] = true;
          k -= 2;
        }
      } else
        break;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << arr[i][0];
    for (int j = 1; j < n; j++) {
      cout << " " << arr[i][j];
    }
    cout << endl;
  }
  return 0;
}
