#include <bits/stdc++.h>
using namespace std;
long long arr[200006], brr[200006];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int x = (n - k) / 2;
  if (n == k) {
    for (int i = 1; i <= n; i++) cout << 1;
    cout << endl;
    return 0;
  }
  for (int i = 1; i <= x; i++) cout << "1";
  cout << "0";
  for (int i = 1; i <= x; i++) cout << "1";
  for (int i = 1; i <= k - 1; i++)
    if (i == 1)
      cout << "0";
    else if ((i - 1) % (x + 1) != 0)
      cout << "1";
    else
      cout << "0";
  cout << endl;
  return 0;
}
