#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y >= 1) {
    if (y % 2) res = (res * x) % p;
    x = ((x % p) * (x % p)) % p;
    y /= 2;
  }
  return res;
}
void solve() {
  long long int n, m;
  cin >> n >> m;
  cout << power(power(2, m, 1000000007) - 1, n, 1000000007) << "\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  t = 1;
  while (t--) {
    solve();
  }
}
