#include <bits/stdc++.h>
using namespace std;
long long f[110][2][2];
int ans[110];
int n;
long long k;
long long calc(long long x, long long a, long long b) {
  if (f[x][a][b] != -1) return f[x][a][b];
  f[x][a][b] = 0;
  int y = n - x + 1;
  if (x > y) return f[x][a][b] = 1;
  for (int i = 0; i < 2; i++)
    if (ans[x] == -1 || ans[x] == i)
      for (int j = 0; j < 2; j++)
        if (ans[y] == -1 || ans[y] == j)
          if (i == j || x < y)
            if (a || i <= j)
              if (b || i + j <= 1)
                f[x][a][b] += calc(x + 1, a || (i < j), b || ((i + j) <= 0));
  return f[x][a][b];
}
int main() {
  scanf("%d %I64d", &n, &k);
  k++;
  memset(f, -1, sizeof(f));
  memset(ans, -1, sizeof(ans));
  if (calc(1, 0, 0) < k) return puts("-1"), 0;
  for (int i = 1; i <= n; i++) {
    memset(f, -1, sizeof(f));
    ans[i] = 0;
    if (calc(1, 0, 0) < k) {
      k -= calc(1, 0, 0);
      ans[i] = 1;
    }
  }
  for (int i = 1; i <= n; i++) printf("%d", ans[i]);
  puts("");
  return 0;
}
