#include <bits/stdc++.h>
using namespace std;
string repetir(char c, int n) {
  string ret = "";
  for (int i = 0; i < n; ++i) ret += c;
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  if (k == 1 && k == 0) {
    cout << "1";
    for (int i = 0; i < n - 1; ++i) cout << "0";
    cout << '\n';
    return 0;
  }
  if (3 * k <= n + 4 && k == 0) {
    cout << repetir('1', k - 2) << "0" << repetir('1', k - 2) << "0"
         << repetir('1', n - 2 * k + 2) << '\n';
  } else {
    int dif = (n - k) / 2;
    string S = "";
    while (S.size() < n) S += repetir('1', dif) + "0";
    cout << S.substr(0, n) << '\n';
  }
  return 0;
}
