#include <bits/stdc++.h>
#pragma gcc optimize("O3")
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int n, k;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cin >> n >> k;
  int oo = 1 + (n - k) / 2;
  for (int i = 0; i < n; ++i)
    if (i % oo != oo - 1)
      cout << 0;
    else
      cout << 1;
  return 0;
}
