#include <bits/stdc++.h>
using namespace std;
long long a[800001], b[500009];
string s;
int main() {
  ios_base::sync_with_stdio(false);
  long long j = 0, n, m, k, kk = 1, m1 = 0, a1 = 0, grtr = 0, a2, l, t, ds, r,
            mx = 0, cnt = 0, mn = INT_MAX, h = 0, mod = 998244353, i;
  cin >> n >> k;
  m = (n - k) / 2;
  m++;
  for (i = 1; i <= n; i++) {
    i % m ? cout << 1 : cout << 0;
  }
  return 0;
}
