#include <iostream>
using namespace std;
int f(int n, int x);
int main()
{
int n, x;
cin >> n >> x;
int a;
a = f(n, x);
cout << a << endl;
}
int f(int n, int x)
{
if (n == 0)
{
return 1;
}
if (n == 1)
{
return 2;
}
if (n > 1)
{
return 2 * x * f(n - 1, x) - 2 * (n - 1) * f(n - 2, x);
}
return 0;
}
using namespace std;
int f(int n, int x);
int main()
{
int n, x;
cin >> n >> x;
int a;
a = f(n, x);
cout << a << endl;
}
int f(int n, int x)
{
if (n == 0)
{
return 1;
}
if (n == 1)
{
return 2;
}
if (n > 1)
{
return 2 * x * f(n - 1, x) - 2 * (n - 1) * f(n - 2, x);
}
return 0;
}