#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int n, k; cin >> n >> k; vector a(n); rep(i, n) a[i] = i; rep(i, 20) { if (k >> i & 1) continue; rep(j, n) { if ((j >> i & 1) == 0) { continue; } if ((j ^ 1 << i) < n) { swap(a[j], a[j ^ 1 << i]); } } } int ans = 0; rep(i, n) { ans |= (i & a[i]); } if (ans == k) { cout << "Yes" << endl; rep(i, n) cout << i << " "; cout << endl; rep(i, n) cout << a[i] << " "; cout << endl; } else { cout << "No" << endl; } return 0; }