#include <bits/stdc++.h>
using namespace std;
const int N = 1000100;
vector<int> edges[N];
int p[N];
void dfs(int cur, int &timer) {
  p[cur] = timer--;
  for (auto it : edges[cur]) {
    dfs(it, timer);
  }
}
void solve() {
  int n;
  int k;
  cin >> n >> k;
  int a = (n - k) / 2;
  for (int i = 0; i < n; i++) {
    cout << (((i + 1) % (a + 1)) == 0);
  }
}
int main() {
  solve();
  return 0;
}
