#include <bits/stdc++.h>
const double PI =
    3.141592653589793238462643383279502884197169399375105820974944;
using namespace std;
long long ModExp(long long x, long long y, long long m) {
  long long res = 1;
  x = x % m;
  while (y > 0) {
    if (y & 1) res = (res * x) % m;
    y = y >> 1;
    x = (x * x) % m;
  }
  return res;
}
void solve() {
  long long n, k;
  cin >> n >> k;
  string s = "";
  long long v = (n - k) / 2;
  while (s.length() + (v + 1) <= n) {
    for (long long i = 0; i < v; i++) {
      s += '1';
    }
    s += '0';
  }
  for (long long i = s.length(); i < n; i++) {
    s += '1';
  }
  cout << s << endl;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  while (t--) {
    solve();
  }
}
