package main
import (
"fmt"
)
func power(base, exp, mod int64) int64 {
var res int64 = 1
base %= mod
for exp > 0 {
if exp%2 == 1 {
res = (res * base) % mod
}
base = (base * base) % mod
exp /= 2
}
return res
}
func main() {
var n, m int64
fmt.Scan(&n, &m)
mod := int64(1000000007)
a := power(2, m, mod)
b := (a - 1 + mod) % mod
fmt.Print(power(b, n, mod))
}