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