#include <bits/stdc++.h>
using namespace std;
int a[111][111];
int main() {
  int N, K, i, k;
  cin >> N >> K;
  if (K > N * N)
    puts("-1");
  else {
    for (i = 0; i < N && K; i++)
      for (k = i; k < N && K; k++) {
        if (K == 1) {
          if (i == k)
            a[i][k] = 1;
          else
            a[i + 1][i + 1] = 1;
          K = 0;
        } else {
          a[i][k] = a[k][i] = 1;
          if (i == k)
            K--;
          else
            K -= 2;
        }
      }
    for (i = 0; i < N; i++)
      for (k = 0; k < N; k++)
        if (k == N - 1)
          cout << a[i][k] << endl;
        else
          cout << a[i][k] << " ";
  }
}
