#include <bits/stdc++.h>
using namespace std;
bool compare(int a, int b) { return a < b; }
struct cmp {
  bool operator()(const pair<int, int> &a, const pair<int, int> &b) const {
    int lena = a.second - a.first + 1;
    int lenb = b.second - b.first + 1;
    if (lena == lenb) return a.first < b.first;
    return lena > lenb;
  }
};
long long int fact(int n) {
  long long int res = 1;
  for (long long int i = n; i >= 1; i++) {
    res = (res * i);
  }
  return res;
}
long long int comb(int n, int r) { return (fact(n) / (fact(r) * fact(n - r))); }
bool checkPower(int x) { return x && (!(x & (x - 1))); }
int primes[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31};
int prime_divisor(int k) {
  int j = 0;
  for (int i = 0; i < 11; i++) {
    if (k % primes[i] == 0) return primes[i];
  }
}
long long power(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  cout << power(power(2, m) - 1, n);
  return 0;
}
