#include <bits/stdc++.h>
using namespace std;
int modexp(long long x, long long n, long long M) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return modexp((x * x) % M, n / 2, M);
  else
    return (x * modexp((x * x) % M, (n - 1) / 2, M)) % M;
}
void solve() {
  long long m, n;
  cin >> n >> m;
  long long ans = modexp(
      (modexp(2, m, 1000000007) - 1 + 1000000007) % 1000000007, n, 1000000007);
  cout << ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long test;
  test = 1;
  while (test--) {
    solve();
  }
  return 0;
}
