#include <bits/stdc++.h>
using namespace std;
int n, k, a[100500], cnt = 1;
bool A[5][5];
bool can(int i, int j) {
  if (j < 0 || j > i) return 0;
  if (i <= 4) return A[i][j];
  if (((i + 1) & -(i + 1)) == (i + 1)) return j != 1 && j != i;
  return j != 0 && j != i;
}
void work(int st, int n, int k) {
  if (n == 0) return;
  int j;
  for (j = 0; j < n; j = j * 2 + 1)
    ;
  for (j /= 2;; j /= 2) {
    int ub = (j > 2 * (n - 1 - j) || 2 * j < (n - 1 - j));
    for (int t = 0; t <= j && t <= k; ++t)
      if (can(j, t) && can(n - 1 - j, k - ub - t)) {
        a[++cnt] = st;
        work(cnt, j, t);
        a[++cnt] = st;
        work(cnt, n - 1 - j, k - ub - t);
        return;
      } else if (t >= 50)
        break;
    if (j == 0) return;
  }
}
int main() {
  A[0][0] = A[1][0] = A[2][1] = A[3][0] = A[3][2] = A[4][1] = A[4][3] = 1;
  int n, k;
  cin >> n >> k;
  if (n % 2 == 0 || !can(n = n / 2, k))
    puts("NO");
  else {
    puts("YES");
    work(1, n, k);
    for (int i = 1; i <= 2 * n + 1; ++i) cout << a[i] << ' ';
  }
}
