#include <bits/stdc++.h>
const int maxn = 1e5 + 5;
using namespace std;
const long long mod = 1e9 + 7;
long long fpow(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret = (ret % mod * a % mod) % mod;
    a = (a % mod * a % mod) % mod;
    b >>= 1;
  }
  return ret;
}
int main() {
  long long n, m;
  scanf("%lld %lld", &n, &m);
  long long ans = fpow(2, m);
  ans = (ans - 1 + mod) % mod;
  ans = fpow(ans, n);
  printf("%lld\n", ans);
  return 0;
}
