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