#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  long long a = (n - k) >> 1;
  for (long long i = 1; i <= n; i++) {
    if (i % (a + 1) == 0)
      cout << 1;
    else
      cout << 0;
  }
}
