#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const int xinc[] = {0, 0, 1, -1};
const int yinc[] = {1, -1, 0, 0};
const long double PI = acos(-1.0);
int n, k;
void solve() {
  cin >> n >> k;
  int d = n - k;
  if (k == 1) {
    cout << 1;
    for (int i = 0; i < n - 1; i++) cout << 0;
    cout << '\n';
    return;
  }
  d /= 2;
  string p = "1";
  for (int i = 0; i < d; i++) p += "0";
  int z = p.size();
  for (int i = 0; i < n; i++) cout << p[i % z];
  cout << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) solve();
  return 0;
}
