#include <bits/stdc++.h>
using namespace std;
long long powi(long long base, long long power) {
  long long result = 1;
  while (power > 0) {
    if (power % 2 == 1) {
      result = (result * base) % 1000000007;
    }
    base = (base * base) % 1000000007;
    power = power / 2;
  }
  return result;
}
int main() {
  long long n, m;
  cin >> n >> m;
  cout << powi((powi(2, m) - 1), n) << endl;
}
