#include <bits/stdc++.h>
using namespace std;
int Set(int N, int pos) { return N = N | (1 << pos); }
int reset(int N, int pos) { return N = N & ~(1 << pos); }
bool check(int N, int pos) { return (bool)(N & (1 << pos)); }
void mor() {
  cout << "NO";
  exit(0);
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int p = (n - k) / 2;
  p++;
  for (int i = 1; i <= n; i++) printf("%d", i % p ? 0 : 1);
  return 0;
}
