#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
int n, k;
bool in[100005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  int dif = (n - k) / 2 + 1;
  int mid = (n / 2);
  for (int i = mid; i >= 0; i -= dif) {
    in[i] = true;
  }
  for (int i = mid; i < n; i += dif) {
    in[i] = true;
  }
  for (int i = 0; i < (signed)(n); i++) {
    if (in[i])
      cout << "1";
    else
      cout << "0";
  }
  return 0;
}
