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