#include <bits/stdc++.h>
using namespace std;
long long quick_pow(long long a, long long b) {
  long long res = 1;
  a = a % 1000000007;
  while (b) {
    if (b & 1) {
      res = (res * a) % 1000000007;
    }
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return res;
}
int main() {
  int n, m;
  cin >> n >> m;
  cout << quick_pow((quick_pow(2, m) - 1), n);
  return 0;
}
