#include <bits/stdc++.h>
using namespace std;
const long long llINF = 9223372036854775807;
const int INF = 2147483647;
const int maxn = 1e5 + 7;
const int maxm = 8e5 + 7;
const long long mod = 998244353;
const double pi = acos(-1.0);
const double eps = 1e-12;
int n, k;
int main(int argc, char const *argv[]) {
  scanf("%d%d", &n, &k);
  int loop = (n - k) / 2;
  for (int i = 1; i <= n; i++) printf("%d", i % (loop + 1) ? 1 : 0);
  return 0;
}
