#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a = (n - k) / 2;
  for (int i = 1; i <= n; ++i) cout << (i % (a + 1) == 0 ? '1' : '0');
  cout << endl;
  return 0;
}
