n,m=map(int,input().split())
mod=1000000000 + 7
def rec(b, n):
    if n==0:
        return 1
    if n%2 == 0:
       return rec(b*b % mod, n/2)
    else:
        return b*rec(b, n-1) % mod

print(rec(2,n+m-2))