#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n, m, sl, fh;
char ans[1000010];
int rd() {
  sl = 0;
  fh = 1;
  char ch = getchar();
  while (ch < '0' || '9' < ch) {
    if (ch == '-') fh = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') sl = sl * 10 + ch - '0', ch = getchar();
  return sl * fh;
}
int main() {
  n = rd();
  m = rd();
  m = (n - m) >> 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m && i <= n; ++j, ++i) ans[i] = '1';
    if (i <= n) ans[i] = '0';
  }
  puts(ans + 1);
  return 0;
}
