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