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