#include <bits/stdc++.h>
using namespace std;
const long long p = 1e9 + 7;
long long mul(long long a, long long b) {
  long long res = 0;
  while (b) {
    if (b & 1) res = (res + a) % p;
    a = (a + a) % p;
    b >>= 1;
  }
  return res;
}
long long quickpow(long long a, long long b) {
  long long res = 1;
  long long x = a % p;
  while (b) {
    if (b & 1) res = mul(res, x) % p;
    b >>= 1;
    x = mul(x, x) % p;
  }
  return res % p;
}
int main() {
  long long n, m;
  cin >> n >> m;
  long long ans = quickpow(2, m);
  if (ans == 0)
    ans = 1e9 + 6;
  else
    ans--;
  long long res = quickpow(ans, n);
  cout << res << endl;
  return 0;
}
