#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int l = (n - k) / 2 + 1;
  string rep;
  string res;
  if (k == 1) {
    res = "0";
    for (int i = 1; i < n; i++) {
      res += "1";
    }
    cout << res;
    return 0;
  } else if (n - k == 2) {
    rep = "01";
  } else {
    rep = "1";
    for (int i = 1; i < l - 1; i++) {
      rep += "0";
    }
    rep += "1";
  }
  res = "";
  while (res.size() < n) {
    res += rep;
  }
  cout << res.substr(0, n);
}
