#include <bits/stdc++.h>
using namespace std;
int n, k, d;
int main() {
  scanf("%d %d", &n, &k);
  if (k == 1) {
    for (int i = 1; i <= n; ++i) printf("%d", i == 1);
    return 0;
  }
  if (n % 2 == 0)
    d = n - (n / 2) - (k - 2) / 2;
  else
    d = n - (n / 2) - (k / 2);
  for (int i = 1, l = -d + 1; i <= n; ++i)
    printf("%d", i - l >= d), l = (i - l >= d ? i : l);
}
