#include <bits/stdc++.h>
using namespace std;
const long long mod(1e9 + 7);
long long qpow(long long a, long long b) {
  long long r = 1, base = a;
  while (b) {
    if (b % 2) {
      r = r * base % mod;
    }
    base = base * base % mod;
    b >>= 1;
  }
  return r % mod;
}
int main() {
  long long n, m, ans;
  cin >> n >> m;
  ans = qpow(qpow(2ll, m) - 1, n) % mod;
  cout << ans << "\n";
}
