#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const long long INF = 1e18 + 7;
int n, k;
int main() {
  cin >> n >> k;
  int period = (n - k) / 2;
  for (int i = 1; i <= n; i++) {
    if (i % (period + 1) == 0)
      cout << '1';
    else
      cout << '0';
  }
}
