#include <bits/stdc++.h>
int main() {
  static char cc[100000 + 1];
  int n, k, a, i;
  scanf("%d%d", &n, &k);
  a = (n - k) / 2;
  for (i = 0; i < n; i++) cc[i] = '0' + (i % (a + 1) == a);
  printf("%s\n", cc);
  return 0;
}
