#include <bits/stdc++.h>
#pragma GCC optimize(3, "Ofast", "inline")
using namespace std;
const int MAXN = (int)2e5 + 10;
const long long mo = (long long)1e9 + 7;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long fpow(long long base, long long cnt) {
  long long ans = 1;
  while (cnt) {
    if (cnt & 1) ans = (ans % mo * base % mo) % mo;
    cnt >>= 1;
    base = (base % mo * base % mo) % mo;
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  cout << fpow(fpow(2, m) - 1, n) << "\n";
  return 0;
}
