#include <bits/stdc++.h>
using namespace std;
inline bool isdigit(char& ch) { return ch >= '0' && ch <= '9'; }
template <class T>
void read(T& x) {
  x = 0;
  long long f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + ch - '0';
  x *= f;
}
template <class T>
inline void write(T x) {
  if (x == 0) {
    putchar('0');
    return;
  }
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  int _stk[65], _top = 0;
  for (; x; x /= 10) _stk[++_top] = x % 10 + 48;
  for (; _top; _top--) putchar(_stk[_top]);
}
int n, m;
int main() {
  read(n);
  read(m);
  int a = (n - m) >> 1;
  a += 1;
  for (int i = (int)(1); i < (int)(n + 1); i++) write(!(i % a));
  return 0;
}
