#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int ram = (n - k) / 2;
  for (int i = 1; i <= n; ++i) {
    if (ram == 0) {
      printf("0");
      ram = (n - k) / 2;
    } else {
      printf("1");
      ram--;
    }
  }
  return 0;
}
