#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  if (m == 1) {
    cout << 1;
    for (int i = 1; i < n; i++) cout << 0;
    return 0;
  }
  int second = (n - m) / 2 + 1;
  for (int i = 0; i < n; i++) cout << (i % second == 0);
}
