#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N, K;
  cin >> N >> K;
  string res(N, '0');
  if (K == 1) {
    res[0] = '1';
  } else {
    long long t = (N - K) / 2;
    for (long long i = 0; i < N; i += t + 1) {
      res[i] = '1';
    }
  }
  cout << res << endl;
}
