#include <bits/stdc++.h>
using namespace std;
unsigned int h(unsigned int n, unsigned int x) {
if (n == 0) {
return 1;
} else if (n == 1) {
return 2 * x;
} else if (n > 1) {
return 2 * x * h(n - 1, x) - 2 * (n - 1) * h(n - 2, x);
}
}
int main() {
unsigned int n, x;
cin >> n >> x;
cout << h(n, x);
return 0;
}