#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long power(long long a, long long b) {
  long long res = 1;
  while (b != 0) {
    if (b & 1) {
      res *= a;
      res %= mod;
    }
    b /= 2;
    a = (a * a) % mod;
  }
  return res;
}
void solve() {
  long long n, m;
  cin >> n >> m;
  long long ans = power(2, m) - 1;
  ans = (ans + mod) % mod;
  cout << power(ans, n) % mod;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) solve();
  return 0;
}
