#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream &operator<<(ostream &cout, vector<T> &a) {
  for (size_t i = 0; i < a.size(); ++i) cout << a[i] << " ";
  return cout;
}
template <typename T>
ostream &operator<<(ostream &cout, vector<vector<T> > &a) {
  for (size_t i = 0; i < a.size(); ++i) cout << a[i] << endl;
  return cout;
}
int a[100][100];
int main() {
  ios_base::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  if (n * n < k) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    for (int j = i; j < n; ++j) {
      if (i == j && k) {
        a[i][j] = 1;
        --k;
      } else if (k > 1) {
        a[i][j] = 1;
        a[j][i] = 1;
        k -= 2;
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      cout << a[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}
