#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000000 + 7;
long long inf = 1e17;
const long long N = 1e5 + 5;
bool prime[N];
long long power(long long a, long long n, long long p) {
  long long res = 1;
  while (n) {
    if (n % 2 == 0) {
      a = (a * a) % p;
      n = n / 2;
    } else {
      n--;
      res = (res * a) % p;
    }
  }
  return (res);
}
void solve() {
  long long n, m;
  cin >> n >> m;
  cout << power((power(2, m, mod) - 1 + mod), n, mod) % mod << endl;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return (0);
}
