#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int mul(int a, int b) { return (long long)a * b % mod; }
inline int Pow(int a, int p) {
  int ret = 1;
  while (p) {
    if (p & 1) ret = mul(ret, a);
    a = mul(a, a);
    p >>= 1;
  }
  return ret;
}
int main() {
  int n, m;
  cin >> n >> m;
  int ans = Pow(2, m) - 1;
  if (ans < 0) ans += mod;
  ans = Pow(ans, n);
  printf("%d\n", ans);
  return 0;
}
