#include <bits/stdc++.h>
using namespace std;
vector<int> pf(string s) {
  int n = (int)s.size();
  vector<int> p(n);
  for (int i = 1; i < n; i++) {
    int k = p[i - 1];
    while (k > 0 && s[i] != s[k]) {
      k = p[k - 1];
    }
    if (s[i] == s[k]) k++;
    p[i] = k;
  }
  return p;
}
int cnt(string s, string t) {
  string to = t;
  to.push_back('&');
  to += s;
  int ans = 0;
  auto ps = pf(to);
  for (int i = (int)t.size() + 1; i < (int)ps.size(); i++) {
    if (ps[i] == (int)t.size()) {
      ans++;
    }
  }
  return ans;
}
int solve(string s) {
  int mn = (int)s.size();
  for (int i = 0; i < (int)s.size(); i++) {
    for (int j = 1; j + i <= (int)s.size(); j++) {
      string t = s.substr(i, j);
      int in = cnt(s, t);
      if (in == 1) {
        mn = min(mn, j);
      }
    }
  }
  return mn;
}
string solve_sol(int n, int k) {
  if (k != 1) {
    int dt = (n - k) / 2;
    string s = "1";
    for (int i = 0; i < dt; i++) {
      s.push_back('0');
    }
    string res(n, '%');
    for (int i = 0; i < n; i++) {
      res[i] = s[i % (int)s.size()];
    }
    return res;
  } else {
    string res(n, '1');
    res[0] = '0';
    return res;
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  bool st = false;
  if (!st) {
    int n, k;
    cin >> n >> k;
    cout << solve_sol(n, k) << endl;
  } else {
    const int MAXN = 50;
    for (int n = 1; n <= MAXN; n++) {
      for (int k = 1; k < MAXN; k++) {
        if (n % 2 == k % 2 && k <= n) {
          string tr = solve_sol(n, k);
          if (solve(tr) != k) {
            cerr << "wa " << n << ' ' << k << endl;
            exit(0);
          }
        }
      }
    }
    cerr << "ok" << endl;
  }
}
