#include <bits/stdc++.h>
using namespace std;
#pragma GCC diagnostic ignored "-Wmissing-declarations"
inline int safe_mul(const int x, const int y)
    __attribute__((warn_unused_result));
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  int c = (n - k) / 2;
  string ans;
  for (int i = 0; i < n; ++i) ans.push_back('0' + (i % (c + 1) < c));
  cout << ans << endl;
}
