#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int MOD = 1e9 + 7;
const int dx[] = {0, 0, 1, -1};
const int dy[] = {1, -1, 0, 0};
const char dir[] = {'R', 'L', 'D', 'U'};
int add(int a, int b) {
  a += b;
  if (a >= MOD) {
    a -= MOD;
  }
  return a;
}
int sub(int a, int b) {
  a -= b;
  if (a < 0) a += MOD;
  return a;
}
int mult(int a, int b) { return ((ll)a * b) % MOD; }
void setIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
}
int main() {
  setIO();
  int n, k;
  cin >> n >> k;
  if (k == 1) {
    cout << 1;
    for (int i = 0; i < n - 1; ++i) {
      cout << 0;
    }
    cout << "\n";
    return 0;
  }
  int dif = (n - k) / 2;
  int len = 0;
  string ans = "";
  while (len < n) {
    ans += '1';
    ++len;
    if (len == n) break;
    for (int i = 0; i < dif; ++i) {
      ans += '0';
      ++len;
      if (len == n) break;
    }
    if (len == n) break;
  }
  cout << ans << "\n";
}
