#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long power(long long x, unsigned long long y, long long mod) {
  long long res = 1;
  x = x % mod;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res;
}
int main() {
  long long n, m;
  cin >> n >> m;
  long long ans = power(2, m, mod) - 1;
  long long ans2 = power(ans, n, mod);
  cout << ans2 << endl;
  return 0;
}
