class Integer def mod_inverse(mod) self.pow(mod - 2, mod) end end N, M = gets.split.map(&:to_i) MOD = 10 ** 9 + 7 puts ((2.pow(M, MOD) - 1) * 2.mod_inverse(MOD)) % MOD