#include <bits/stdc++.h>
int n, k, diff;
std::string ans;
int main() {
  std::cin >> n >> k;
  diff = (n - k) / 2;
  for (int i = 0; i < n; i++) ans.push_back('1');
  if (diff) {
    for (int i = diff; i < n; i += diff + 1) ans[i] = '0';
  }
  std::cout << ans;
  return 0;
}
