#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
struct less_key {
  bool operator()(pair<long long int, long long int> p1,
                  pair<long long int, long long int> p2) {
    return p1.first > p2.first ||
           (p1.first == p2.first && p1.second < p2.second);
  }
};
struct pair_hash {
 public:
  std::size_t operator()(const std::pair<unsigned long long int,
                                         unsigned long long int>& x) const {
    return std::hash<unsigned long long int>()(x.first) ^
           std::hash<unsigned long long int>()(x.second);
  }
};
const long long int mod = 1000000007ll;
const long long int smod = 998244353ll;
const long long int inf = 10000000000000007ll;
const double eps = 1e-10;
const long long int MAXN = 100005;
long long int n, k;
long long int check(const string& s) {
  map<string, long long int> q;
  for (long long int i = 1; i <= s.size(); i++) {
    for (long long int j = 0; j + i <= s.size(); j++) {
      string t = s.substr(j, i);
      q[t]++;
    }
  }
  long long int R = -1;
  for (auto p : q) {
    if (p.second > 1) {
      continue;
    }
    if (R == -1) {
      R = p.first.size();
      continue;
    }
    R = min(R, (long long int)p.first.size());
  }
  return R;
}
string gen(long long int q, long long int k) {
  for (long long int i = 0; i < (1ll << q); i++) {
    stringstream ss;
    long long int t = i;
    for (long long int j = 0; j < q; j++) {
      ss << (t & 1);
      t >>= 1;
    }
    string s = ss.str();
    long long int c = check(s);
    if (check(s) == k) {
      cerr << "!" << s << endl;
    }
  }
  return "";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.precision(15);
  cout.setf(ios::fixed);
  cin >> n >> k;
  stringstream ss;
  long long int t = (n - k) / 2;
  for (long long int i = 0; i < n; i++) {
    if (i % (t + 1) == t) {
      ss << 1;
    } else {
      ss << 0;
    }
  }
  string R = ss.str();
  cout << R;
  return 0;
}
