mod = 10 ** 9 + 7 n, m = map(int, input().split()) inv_2 = pow(2, mod - 2, mod) print(inv_2 * (pow(2, m, mod) - 1) % mod)