#include <bits/stdc++.h>
using namespace std;
namespace _ {
bool rEOF = 1;
inline char nc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && rEOF &&
                 (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? (rEOF = 0, EOF)
             : *p1++;
}
template <class _T>
inline bool read(_T &num) {
  char c = nc(), f = 1;
  num = 0;
  while (c < '0' || c > '9') c == '-' && (f = -1), c = nc();
  while (c >= '0' && c <= '9') num = num * 10 + c - '0', c = nc();
  return (bool)(num *= f);
}
inline bool need(char &c) {
  return c >= 'a' && c <= 'z' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z';
}
inline bool read_str(char *a) {
  while ((*a = nc()) && need(*a) && rEOF) ++a;
  *a = '\0';
  return rEOF;
}
}  // namespace _
using namespace _;
void file(bool opt, const char s[]) {
  if (opt && fopen(s, "r")) {
    freopen(s, "r", stdin);
  }
}
int n, m;
const int mod = 1e9 + 7;
long long ksm(long long a, long long b) {
  long long res = 1;
  for (a %= mod; b; b >>= 1, a = a * a % mod)
    if (b & 1) res = res * a % mod;
  return res;
}
int main() {
  cin >> n >> m;
  cout << ksm((ksm(2, m) - 1 + mod) % mod, n) << endl;
  return 0;
}
