#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10, mod = 1e9 + 7;
const long long inf = 1e18;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  int x = (n - (k - 2)) / 2;
  if (k == 1) x = n;
  for (int i = 0; i < n; i++) {
    cout << (i % x == 0);
  }
  return cout << endl, 0;
}
