#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
const int MOD = 1e9 + 7;
ll pot(ll b, ll e) {
  ll res = 1;
  while (e) {
    if (e % 2) res = (res * b) % MOD;
    e /= 2;
    b = (b * b) % MOD;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  cout << pot(pot(2, m) - 1 + MOD, n) << "\n";
}
