#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e3 + 2;
int hArr[maxn];
int wArr[maxn];
long long pow_mod(long long a, long long b, long long N) {
  long long result = 1;
  a = a % N;
  while (b > 0) {
    if (b % 2 == 1) {
      result = result * a;
      result = result % N;
      b--;
    }
    b /= 2;
    a = (a * a) % N;
  }
  return result;
}
int main() {
  long long n, m;
  long long fmart = 1e9 + 7;
  cin >> n >> m;
  long long res = pow_mod(2, m, fmart) - 1;
  res = pow_mod(res, n, fmart);
  cout << res << endl;
}
