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