#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
using namespace std;
const long long inf = 1e15;
mt19937 random1(16783849);
long long randlr(long long l, long long r) {
  return random1() % (r - l + 1) + l;
}
signed main() {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  long long n, k;
  cin >> n >> k;
  long long a = (n - k) / 2;
  long long cnt = 0;
  while (cnt < n) {
    for (long long i = 0; i < a; i++) {
      cout << '0';
      cnt++;
      if (cnt == n) break;
    }
    if (cnt != n) {
      cout << '1';
      cnt++;
    }
  }
  return 0;
}
