#include main(){long n,m;std::cin>>n>>m;std::cout<<((atcoder::modint1000000007(2).pow(m)-1)/2).val();}