#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e5 + 10;
const long long INF = 0x3f3f3f3f;
const long long MOD = 1e9 + 7;
const long double eps = 1e-5;
long long n, k;
inline long long read() {
  long long s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * w;
}
signed main() {
  while (cin >> n >> k) {
    for (long long i = 0, j = (n - k) / 2; i < n; i++) {
      if (j) {
        cout << 1;
        j--;
      } else {
        cout << 0;
        j = (n - k) / 2;
      }
    }
    cout << endl;
  }
  return 0;
}
