#include <bits/stdc++.h>
using namespace std;
long long bign = 1000000007;
long long poww(long long a, long long b) {
  if (b == 0) return 1;
  long long k = poww(a, b / 2);
  if (b % 2 == 0)
    return ((k % bign) * (k % bign)) % bign;
  else
    return (((a % bign) * (k % bign)) % bign * (k % bign)) % bign;
}
int main() {
  unsigned long long n, m, ans, p;
  cin >> n >> m;
  p = poww(2, m) - 1;
  ans = poww(p, n);
  cout << ans << "\n";
  return 0;
}
