MOD = 10 ** 9 + 7 N, M = map(int, input().split()) a = pow(2, M, MOD) tmp = a * (a - 1) * pow(2, -1, MOD) print((tmp * pow(2, -M, MOD)) % MOD)