#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long n, m, ans;
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  return f * x;
}
inline void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
  return;
}
inline long long qpow(long long x, long long y) {
  long long ret = 1;
  while (y) {
    if (y & 1) ret = 1LL * ret * x % mod;
    y >>= 1;
    x = 1LL * x * x % mod;
  }
  return ret;
}
int main() {
  n = read(), m = read();
  m = qpow(2, m) - 1;
  m = (1LL * m + mod) % mod;
  ans = qpow(m, n);
  write(ans);
  return 0;
}
