#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
int main() {
  long long m, n;
  cin >> n >> m;
  cout << binpow((binpow(2, m) - 1), n) << "\n";
  return 0;
}
