#include <bits/stdc++.h>
using namespace std;
long long power(long long n, long long m) {
  long long res = 1;
  while (m > 0) {
    if (m % 2 == 1) {
      res = (res % 1000000007 * n % 1000000007) % 1000000007;
    }
    n = n % 1000000007 * n % 1000000007;
    m = m >> 1;
  }
  return res;
}
int main() {
  long long n, m;
  cin >> n >> m;
  long long p = power(power(2, m) - 1, n);
  cout << p << endl;
}
