#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int ones = (n - k) / 2;
  if (k == 1) {
    cout << 0;
    while (--n) cout << 1;
    cout << endl;
    return 0;
  }
  vector<int> period = {0};
  while (ones--) period.push_back(1);
  for (int i = 0, j = 0; i < n; ++i) {
    cout << period[j];
    j++;
    if (j == period.size()) j = 0;
  }
  cout << endl;
}
