#include <bits/stdc++.h>
using namespace std;
int a = 1 << 18, b = 1 << 19;
int main() {
  int n, x;
  scanf("%d", &n);
  scanf("%d", &x);
  if (n == 1)
    printf("Yes\n%d\n", x);
  else if (n == 2) {
    if (x == 0)
      printf("No\n");
    else
      printf("Yes\n0 %d\n", x);
  } else {
    printf("Yes\n");
    int ans = 0;
    int i = 1;
    for (i = 1; i <= n - 3; i++) {
      printf("%d ", i);
      ans ^= i;
    }
    printf("%d %d ", a, b);
    printf("%d\n", ans ^ a ^ b ^ x);
  }
  return 0;
}
