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