#include <bits/stdc++.h>
static char buf[100000], *p1 = buf, *p2 = buf;
inline int read(void) {
  register bool f = false;
  register char ch =
      (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
           ? EOF
           : *p1++);
  register int res = 0;
  while (ch < '0' || '9' < ch)
    f |= (ch == '-'),
        ch = (p1 == p2 &&
                      (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
                  ? EOF
                  : *p1++);
  while ('0' <= ch && ch <= '9')
    res = 10 * res + ch - '0',
    ch = (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
              ? EOF
              : *p1++);
  return f ? -res : res;
}
int n, k;
int main(void) {
  register int i;
  n = read(), k = read();
  for (i = 1; i <= n; ++i)
    printf(i == n ? "%d\n" : "%d", i % ((n - k) / 2 + 1) > 0);
  return 0;
}
