#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
const long long int mo = 1e9 + 7;
inline long long int pw(long long int a, long long int n) {
  long long int sum(1);
  for (; n; n >>= 1) {
    if (n & 1) sum = (sum * a) % mo;
    a = (a * a) % mo;
  }
  return sum;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  printf("%lld", pw(pw(2, m) - 1, n));
  return 0;
}
