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