#include <bits/stdc++.h>
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int T = (n - k) / 2 + 1;
  int s = n % T;
  for (int i = 0; i < s; ++i) printf("0");
  for (int i = 0; i < n - s; ++i) {
    if (i % T == 0)
      printf("1");
    else
      printf("0");
  }
}
