#include using namespace std; using ll = long long; using Graph = vector >; #define rep(i, a, b) for(int i = a; i < b; i++) #define rrep(i, a, b) for(int i = a; i >= b; i--) #define fore(i, a) for(auto &i:a) #define all(x) (x).begin(),(x).end() const int INFI = 1 << 30; const ll INFL = 1LL << 60; const ll MOD = 1000000007; ll modpow(ll base, ll power) { ll res = 1; while (power) { if (power & 1) res = res * base % MOD; base = base * base % MOD; power >>= 1; } return res; } int main() { cin.tie(0); ios::sync_with_stdio(false); ll n, m; cin >> n >> m; cout << (modpow(2, m) - 1) * (MOD + 1) / 2 % MOD << "\n"; }