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