#include <bits/stdc++.h>
const int oo = 0x7fffffff;
const long long OO = 0x7fffffffffffffff;
template <class T>
std::ostream& operator<<(std::ostream& O, const std::vector<T>& V) {
  for (const T& x : V) O << x << " ";
  O << "\n";
  return O;
}
template <class T1, class T2>
std::ostream& operator<<(std::ostream& O, const std::pair<T1, T2>& P) {
  return O << "(" << P.first << ", " << P.second << ")";
}
using namespace std;
string unique_s(string s) {
  map<string, int> ct;
  int n = s.size();
  for (int l = 1; l <= n; ++l) {
    ct.clear();
    for (int i = 0; (i + l) <= n; ++i) {
      auto t = s.substr(i, l);
      ct[t]++;
    }
    for (auto p : ct)
      if (p.second == 1) return p.first;
  }
  return string();
}
string solve(int N, int M) {
  string s;
  for (int i = 0; i < (1 << N); ++i) {
    s = (bitset<100>(i)).to_string().substr(100 - N);
    if (M == unique_s(s).size()) return s;
  }
  return string("-1");
}
string solve_2(int N, int M) {
  if (M == 1) return "1" + string(N - 1, '0');
  if (N == M) return string(N, '0');
  int l = M - 2;
  if ((3 * l + 2) <= N) {
    string z(M - 2, '0');
    return string(N - (2 * l + 2), '0') + "1" + z + "1" + z;
  }
  string z((N - M) / 2, '0');
  string s;
  while (s.size() < N) s += z + "1";
  return s.substr(0, N);
}
int main() {
  int n;
  cin >> n;
  int m;
  cin >> m;
  cout << solve_2(n, m) << "\n";
  return 0;
}
