#include <bits/stdc++.h>
using namespace std;
const int limit = 1000000;
int n, k;
int v[limit];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k;
  int a = (n - k) / 2;
  string s(n, ' ');
  for (int i = 0; i < n; i++) {
    char &c = s[i];
    if (i % (a + 1) == a)
      c = '1';
    else
      c = '0';
  }
  cout << s << endl;
}
