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