#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  int a = (n - k) / 2;
  while (n >= (a + 1)) {
    for (int i = 0; i < a && n > 0; i++, n--) {
      cout << "0";
    }
    cout << "1";
    n--;
  }
  while (n) {
    cout << "0";
    n--;
  }
  cout << endl;
  return 0;
}
