#include <bits/stdc++.h>
const int INF = 0x3f3f3f3f;
const int maxn = 100000 + 10;
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  int mid = (n - k) / 2;
  int j = mid;
  for (int i = 0; i < n; i++)
    if (j) {
      printf("1");
      j--;
    } else {
      printf("0");
      j = mid;
    }
  printf("\n");
  return 0;
}
