#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int t = 1;
  while (t--) {
    int n, k;
    cin >> n >> k;
    int z = (n - k) / 2;
    if (k == 1) {
      string s = "";
      s.push_back('1');
      for (int i = 1; i < n; i++) s.push_back('0');
      cout << s << endl;
      continue;
    }
    string s = "";
    s.push_back('1');
    int i = 1, j = 0;
    while (i < n) {
      if (j < z) {
        s.push_back('0');
        j++;
      } else {
        s.push_back('1');
        j = 0;
      }
      i++;
    }
    cout << s << endl;
  }
  return 0;
}
