n, m = map(int, input().split()) mod = 1_000_000_007 ans = (pow(2, m, mod)-1) * pow(2, mod-2, mod) % mod print(ans)