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