#include <bits/stdc++.h>
using namespace std;
long long i = 0, j = 0, k = 0, sum = 0, res = 0, start = 0, finall = 0, mx = 0,
          mini = 1000000007, len = 0, cnt1 = 0, cnt2 = 0, ans = 0, cnt3 = 0,
          eend = 0, pos = 0, cnt = 0;
int flag = 0;
long long modpow(long long x, long long y) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) {
      ans = (ans * x) % 1000000007;
      y--;
    }
    x = (x * x) % 1000000007;
    y /= 2;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, m;
  cin >> n >> m;
  ans = modpow(2, m);
  ans -= 1;
  ans = modpow(ans, n);
  cout << ans << "\n";
}
