#include <bits/stdc++.h>
using namespace std;
long long int power(int x, int y) {
  long long int pr = 1, p = 1;
  if (y > 0) pr = power(x, y / 2);
  if (y % 2 == 1)
    p = ((pr * pr) % 1000000007 * x) % 1000000007;
  else
    p = ((pr * pr)) % 1000000007;
  return p;
}
int main() {
  int n, m;
  cin >> n >> m;
  long long int pr = power(2, m);
  pr = pr - 1;
  long long int q = power(pr, n);
  cout << q << endl;
}
