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