#include <bits/stdc++.h>
using namespace std;
int cnt = 0;
vector<int> cand;
bool prime[100006];
void SieveOfEratosthenes(int n) {
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
}
int prob = 0;
void dfs(vector<int> adj[], int v, bool visited[], stack<int>& s,
         bool visited2[]) {
  visited[v] = true;
  int i;
  int c = 1;
  bool f = true;
  for (i = 0; i < adj[v].size(); i++) {
    if (!visited[adj[v][i]]) {
      f = false;
      dfs(adj, adj[v][i], visited, s, visited2);
    }
  }
  if (adj[v].size() == 1) {
    s.push(v);
    visited2[v] = true;
  }
}
long long power(long long x, long long y) {
  long long res = 1;
  x = x % 1000000007;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % 1000000007;
    y = y >> 1;
    x = (x * x) % 1000000007;
  }
  return res;
}
long long add(long long x, long long y) {
  x += y;
  while (x >= 998244353) x -= 998244353;
  while (x < 0) x += 998244353;
  return x;
}
long long mul(long long x, long long y) { return (x * 1ll * y) % 998244353; }
long long binpow(long long x, long long y) {
  long long z = 1;
  while (y) {
    if (y & 1) z = mul(z, x);
    x = mul(x, x);
    y >>= 1;
  }
  return z;
}
long long inv(long long x) { return binpow(x, 998244353 - 2); }
long long divide(long long x, long long y) { return mul(x, inv(y)); }
long long fact[200009];
void precalc() {
  fact[0] = 1;
  for (long long i = 1; i < 200009; i++) fact[i] = mul(fact[i - 1], i);
}
long long C(long long n, long long k) {
  return divide(fact[n], mul(fact[k], fact[n - k]));
}
bool comp(pair<double, int> a, pair<double, int> b) {
  if (a.first == b.first) return a.second < b.second;
  return a.first < b.first;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << fixed << setprecision(10);
  cerr << fixed << setprecision(5);
  int t = 1;
  while (t--) {
    long long n, m;
    cin >> n >> m;
    cout << power((power(2, m) - 1), n) << "\n";
  }
  return 0;
}
