#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int prime[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41};
const int N = 1e7 + 7, M = 2 * N;
long long n, m, t, a, b, x, k, row, col, r, c;
string s;
vector<long long> st;
long long power(long long x, long long y) {
  long long temp;
  if (y == 0) return 1;
  temp = power(x, y / 2);
  if (y % 2 == 0)
    return (temp * temp) % mod;
  else {
    if (y > 0)
      return x % mod * temp % mod * temp % mod;
    else
      return (temp % mod * temp % mod) / x % mod;
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  cout << power(power(2, m) - 1, n) % mod;
}
