#include <bits/stdc++.h>
const long long Inf = 1e18;
long long LINF = (long long)2e18;
using namespace std;
long long mod = 1e9 + 7;
long long mod3 = 998244353;
long long mod2 = 1e9 + 123;
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.setf(ios::fixed);
  cout.precision(20);
  int n, k;
  cin >> n >> k;
  int per = (n - k) / 2 + 1;
  string kek = "";
  for (long long(i) = 0; (i) < per - 1; (i)++) kek.push_back('1');
  kek.push_back('0');
  string ans(n, '-');
  int pos = (n - k) / 2;
  int cnt = 0;
  int cur = 0;
  for (int i = 0; i < n; i++) {
    ans[i] = kek[cur];
    cur++;
    cur %= per;
  }
  cout << ans;
  return 0;
}
