n,m = map(int,input().split()) mod = 10 ** 9 + 7 res = pow(2,m,mod) res -= 1 res %= mod print(pow(2,mod-2,mod)*res % mod)