#include <bits/stdc++.h>
using namespace std;
const long long int maxn = 2e5 + 1;
long long int power(long long int a, long long int b) {
  long long int res = 1;
  while (b > 0) {
    if (b % 2 != 0) res = ((res % 1000000007) * (a % 1000000007)) % 1000000007;
    b /= 2;
    a = ((a % 1000000007) * (a % 1000000007)) % 1000000007;
  }
  return res;
}
void solve() {
  long long int N, M;
  cin >> N >> M;
  long long int ans = ((power(2, M) - 1) + 1000000007) % 1000000007;
  ans = power(ans, N);
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int T = 1, p = 0;
  do {
    solve();
    p++;
  } while (p < T);
  return 0;
}
