#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using ll = long long int;
using lnt = long long int;
using Graph = vector<vector<int>>;
using Wgraph = vector<vector<pair<int, long long int>>>;
long long int INF = 1001001001001001LL;
int inf = 1000000007;
long long int MOD = 1000000007LL;
double PI = 3.1415926535897932;
long long int di[] = {-1, 0, 1, 0, -1, 1, 1, -1};
long long int dj[] = {0, 1, 0, -1, 1, 1, -1, -1};
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
inline void yes() { cout << "yes" << endl; }
inline void Yes() { cout << "Yes" << endl; }
inline void YES() { cout << "YES" << endl; }
inline void no() { cout << "no" << endl; }
inline void No() { cout << "No" << endl; }
inline void NO() { cout << "NO" << endl; }
inline void possible() { cout << "possible" << endl; }
inline void Possible() { cout << "Possible" << endl; }
inline void POSSIBLE() { cout << "POSSIBLE" << endl; }
inline void impossible() { cout << "impossible" << endl; }
inline void Impossible() { cout << "Impossible" << endl; }
inline void IMPOSSIBLE() { cout << "IMPOSSIBLE" << endl; }
int main() {
  int n, k;
  cin >> n >> k;
  lint len = (n - k) / 2;
  string ans = "";
  for (int i = 0; i < n; i++) {
    if (i % (len + 1) == len)
      ans += "1";
    else
      ans += "0";
  }
  cout << ans << endl;
  return 0;
}
