#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3c3c3c3c;
const long long LINF = 1ll * INF * INF * 2;
const int N = 1000001;
int n, m;
int x[N];
int ans[N];
int main(void) {
  scanf("%d%d", &n, &m);
  if (m == 1) {
    printf("0");
    for (int i = 1; i < n; i++) printf("1");
    return 0;
  }
  int T = (n - m) / 2 + 1;
  for (int i = 0; i < T - 1; i++) x[i] = 1;
  x[T] = 0;
  for (int i = 0; i < n; i++) printf("%d", x[i % T]);
}
