#include <bits/stdc++.h>
using namespace std;
mt19937 mt_rand(time(0));
const int N = 1e5 + 5, MOD = 1e9 + 7;
int n, m;
long long pot(long long a, long long p) {
  if (p == 0) return 1;
  long long w = pot(a, p / 2);
  w = w * w % MOD;
  if (p % 2) w = w * a % MOD;
  return w;
}
int main() {
  scanf("%d%d", &n, &m);
  printf("%lld", pot(pot(2, m) - 1, n));
  return 0;
}
