#include <bits/stdc++.h>
using namespace std;
void ECHO(string _s) {
  cout << endl;
  (void)_s;
}
template <typename T, typename... Args>
void ECHO(string _s, T x, Args... args) {
  int _i;
  string _s2 = "";
  for (_i = 0; _i < (int)(_s).size(); ++_i) {
    if (_s[_i] == ',') break;
    if (_s[_i] != ' ') _s2 += _s[_i];
  }
  if (_i == (int)(_s).size()) {
    --_i;
  }
  cout << "  (" << _s2 << "):" << x;
  ECHO(_s.substr(_i + 1, (int)(_s).size() - _i - 1), args...);
}
template <typename T0, typename T1>
inline ostream& operator<<(ostream& os, pair<T0, T1>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
inline ostream& operator<<(ostream& os, vector<T>& v) {
  for (int i = 0; i < (int)(v).size(); ++i) {
    if (i > 0) cout << "_";
    cout << v[i];
  }
  cout << endl;
  return os;
}
inline long long _gcd(long long a, long long b) {
  while (b) b %= a ^= b ^= a ^= b;
  return a;
}
mt19937 ran(time(0));
const long double PI = acos(-1);
const long double eps = 1e-9;
int main() {
  ios::sync_with_stdio(false);
  long long n, k, i, cont = 0, a, temp;
  cin >> n >> k;
  a = (n - k) / 2;
  while (true) {
    for (i = 0; i < a && cont < n; ++i, ++cont) cout << "0";
    if (cont == n) break;
    cout << "1";
    ++cont;
  }
  cout << "\n";
  return 0;
}
