#include <bits/stdc++.h>
using namespace std;
long long bigMod(long long a, long long b) {
  if (!b) return 1;
  long long x = bigMod(a, b / 2) % 1000000007;
  x = (x * x) % 1000000007;
  if (b & 1) x = (x * a) % 1000000007;
  return x;
}
void solve() {
  long long n, m, each;
  cin >> n >> m;
  each = bigMod(2, m) - 1;
  long long res = bigMod(each, n);
  cout << res << '\n';
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int t = 1;
  while (t--) solve();
  return 0;
}
