#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007LL;
long long large = 2000000000000000000LL;
int main() {
  int n, k;
  cin >> n >> k;
  int z = (n - k) / 2;
  int t = z;
  while (n--) {
    if (t) {
      cout << 0;
      t--;
    } else {
      cout << 1;
      t--;
    }
    if (t < 0) t = z;
  }
  return 0;
}
