#include <bits/stdc++.h>
using namespace std;
void gen(int n, int k, string r) {
  vector<string> dfr;
  for (int i = 0; i < (1 << n); i++) {
    string s = "";
    for (int j = 0; j < n; j++) {
      if (i & (1 << j))
        s += '1';
      else
        s += '0';
    }
    int mk = 0;
    for (int j = 1; j <= k && !mk; j++) {
      map<string, int> df;
      for (int p = 0; p <= n - j; p++) {
        string temp = s.substr(p, j);
        df[temp]++;
      }
      for (auto p = df.begin(); p != df.end(); p++) {
        if (p->second == 1) {
          if (j == k) {
            dfr.push_back(s);
          } else {
            mk = 1;
            break;
          }
        }
      }
    }
  }
  sort(dfr.begin(), dfr.end());
  int pres = 0;
  for (int i = 0; i < dfr.size(); i++) {
    if (dfr[i] == r) pres = 1;
  }
  if (pres)
    cout << "YES\n";
  else
    cout << "NO\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  int x = (n - k) / 2;
  int ctr = 2;
  string s = "01";
  if (k == 1 && n == 1) {
    cout << 1 << '\n';
    return 0;
  }
  if (k == n) {
    for (int i = 0; i < n; i++) cout << 1;
    cout << '\n';
    return 0;
  }
  if (k == 2) {
    string ans = "11";
    while (ans.length() < n) {
      ans.push_back('0');
    }
    reverse(ans.begin(), ans.end());
    cout << ans << '\n';
    return 0;
  }
  if (k == 1) {
    string ans = "1";
    while (ans.length() < n) {
      ans.push_back('0');
    }
    reverse(ans.begin(), ans.end());
    cout << ans << '\n';
    return 0;
  }
  while (ctr < n) {
    for (int i = 0; i < x && ctr < n; i++) s.push_back('0'), ctr++;
    if (ctr < n) s.push_back('1'), ctr++;
  }
  reverse(s.begin(), s.end());
  cout << s << '\n';
}
