#include <bits/stdc++.h>
const long long inf = 0x3f3f3f3f3f3f3f3LL;
const long long mod = (long long)1e9 + 7;
using namespace std;
template <class T>
void smin(T& a, T val) {
  if (a > val) a = val;
}
template <class T>
void smax(T& a, T val) {
  if (a < val) a = val;
}
const long long N = 5 * (long long)1e5 + 10;
long long n, k;
bool check(string s) {
  map<string, long long> M;
  for (long long i = 0; i < n; ++i) {
    string str = "";
    for (long long j = i; j < n; ++j) {
      str += s[j];
      M[str]++;
    }
  }
  long long len = inf;
  for (auto it : M) {
    if (it.second == 1) {
      smin(len, (long long)(it.first.size()));
    }
  }
  return (len == k);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  long long diff = (n - k) / 2;
  for (long long i = 0; i < n; ++i) {
    if (diff == 0) {
      cout << 1;
      diff = (n - k) / 2;
      continue;
    }
    cout << 0;
    --diff;
  }
  return 0;
}
