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