#include <bits/stdc++.h>
using namespace std;
long long power(long long x, unsigned long long y, long long p = 1000000007) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
void input(vector<long long> &arr, long long n) {
  for (long long i = 0; i < n; i++) cin >> arr[i];
}
long long sumarr(vector<long long> &arr, long long n) {
  long long sum = 0;
  for (long long i = 0; i < n; i++) sum += arr[i];
  return sum;
}
vector<long long> prearr(vector<long long> &arr, long long n) {
  vector<long long> temp(n);
  temp[0] = arr[0];
  for (long long i = 1; i < n; i++) temp[i] = temp[i - 1] + arr[i];
  return temp;
}
vector<long long> postarr(vector<long long> &arr, long long n) {
  vector<long long> temp(n);
  temp[n - 1] = arr[n - 1];
  for (long long i = n - 2; i >= 0; i--) temp[i] = temp[i + 1] + arr[i];
  return temp;
}
bool isint(double a) {
  if (ceil(a) == floor(a)) return true;
  return false;
}
int32_t main() {
  long long tt = 1;
  while (tt--) {
    long long n, m;
    cin >> n >> m;
    long long temp = power(2, m) - 1;
    cout << power(temp, n) << "\n";
  }
  return 0;
}
