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