#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000001;
const long double EPS = 1e-9;
const int MOD = 1000000007;
const long long LLINF = 1000000000000000001;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int k, n;
  cin >> n >> k;
  if (n == k) {
    for (int i = 1; i <= n; i++) cout << 1;
  } else {
    int r = n - k;
    r = r / 2 + 1;
    for (int i = 1; i <= n; i++) {
      if (i % r == 0)
        cout << 0;
      else
        cout << 1;
    }
  }
}
