int output(int n, int x) {
    if (n == 0)
        return 1;
    else if (n == 1)
        return 2 * n;
    else
        return 2 * x * output(n - 1, x) - 2 * (n - 1) * output(n - 2, x);
}
int main() {
    unsigned n, x;
    scanf("%d %d", &n, &x);
    printf("%d", output(n, x));
    return 0;
}