#include <bits/stdc++.h>
using namespace std;
long long power(long long base, int exp) {
  if (exp == 1) return base;
  if (exp == 0) return 1LL;
  if (exp & 1) {
    return power(base, exp - 1) * base % ((long long)(1e9 + 7));
  } else {
    long long half = power(base, exp / 2);
    return half * half % ((long long)(1e9 + 7));
  }
}
int main() {
  long long n, m;
  cin >> n >> m;
  long long a = power(2, m);
  if (a <= 0) a += ((long long)(1e9 + 7));
  a -= 1;
  cout << power(a, n) << '\n';
}
