#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
int n, k;
char answer[MAXN];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    if (i % ((n - k) / 2 + 1) == 0)
      answer[i - 1] = '1';
    else
      answer[i - 1] = '0';
  }
  cout << answer << '\n';
}
