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