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