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