#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7, n, m;
long long fastPower(long long first, long long second) {
  if (second <= 0) return 1;
  long long res2 = 1, res1 = 1;
  if (second & 1) res2 = first;
  res1 = fastPower(first, second / 2);
  res1 = (res1 * res1) % mod;
  return (res1 * res2) % mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  cout << fastPower(fastPower(2, m) - 1, n);
}
