#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, k;
  string s;
  cin >> n >> k;
  k = (n - k + 2) / 2;
  for (i = 1; i <= n; i++) {
    if (i % k == 0)
      s.push_back('1');
    else
      s.push_back('0');
  }
  cout << s << endl;
}
