#include <bits/stdc++.h>
using namespace std;
template <class T>
struct rge {
  T b, e;
};
template <class T>
rge<T> range(T i, T j) {
  return rge<T>{i, j};
}
struct debug {
  template <class T>
  debug& operator<<(const T&) {
    return *this;
  }
};
using ll = long long;
template <typename T>
void min_self(T& a, T b) {
  a = min(a, b);
}
template <typename T>
void max_self(T& a, T b) {
  a = max(a, b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  if (k == 1) {
    for (int i = 0; i < int(n - 1); i++) cout << 1;
    cout << 0 << endl;
    exit(0);
  }
  int zeros = (n - k) / 2;
  string ans;
  string tmp;
  tmp.push_back('1');
  for (int zzz = 0; zzz < int(zeros); zzz++) tmp.push_back('0');
  while ((int)ans.length() < n) ans += tmp;
  while ((int)ans.length() > n) {
    ans.pop_back();
  }
  cout << ans << endl;
}
