#include <bits/stdc++.h>
using namespace std;
int64_t nCr(int64_t n, int64_t r) {
  int64_t tmp = n - r;
  for (int64_t i = n - 1; i > tmp; i--) n *= i;
  for (int64_t i = r - 1; i > 1; i--) r *= i;
  return n / r;
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int64_t n, k;
  cin >> n >> k;
  int64_t patr = (n - k) / 2;
  for (int64_t i = 0; i < n; i++) cout << (((i + 1) % (patr + 1)) == 0);
  return 0;
}
