#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7, inv2 = (MOD + 1) / 2;
double eps = 1e-6;
long long INF = 1e15;
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
long long read() {
  long long v = 0, f = 1;
  char c = getchar();
  while (c < 48 || 57 < c) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (48 <= c && c <= 57) v = (v << 3) + v + v + c - 48, c = getchar();
  return v * f;
}
long long pw(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % MOD;
    x = x * x % MOD;
    y >>= 1;
  }
  return res;
}
int main() {
  long long n = read(), m = read();
  long long t = pw(2, m);
  t = (t - 1 + MOD) % MOD;
  long long ans = pw(t, n);
  printf("%I64d\n", ans);
}
