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