#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
long long dx[] = {1, -1, 0, 0};
long long dy[] = {0, 0, 1, -1};
template <class T>
inline void chmax(T &a, const T &b) {
  if (a < b) a = b;
}
template <class T>
inline void chmin(T &a, const T &b) {
  if (a > b) a = b;
}
template <typename T>
using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast {
  Fast() {
    std::cin.tie(0);
    ios::sync_with_stdio(false);
  }
} fast;
long long solve() {
  long long n, k;
  cin >> n >> k;
  if (k == 1) {
    string res(n, '0');
    res[0] = '1';
    cout << res << endl;
    return 0;
  }
  long long m = (n - k) / 2;
  string res = "";
  while (((long long)(res).size()) < n) {
    res += "1";
    res += string(m, '0');
  }
  cout << res.substr(0, n) << endl;
  return 0;
}
signed main() {
  solve();
  return 0;
}
