#include <bits/stdc++.h>
using namespace std;
struct triplet {
  int index, a, b;
};
bool comp(triplet &t1, triplet &t2) { return (t1.a < t2.a); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k;
  cin >> n >> k;
  string s = "";
  if (k == 1) {
    for (int i = 0; i < n - 1; i++) s += "0";
    s += "1";
    cout << s;
    return 0;
  }
  int x = (n - k) / 2 + 1;
  for (int i = 1; i <= n; i++)
    if (i % x == 0)
      cout << "1";
    else
      cout << "0";
}
