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