#include <bits/stdc++.h>
using namespace std;
const long long N = 1e9 + 7;
const int P = 1e6 + 9;
long long n, m;
long long bin_pow(int a, int x) {
  if (x == 1) return a % N;
  if (x % 2 == 0) return (bin_pow(a, x / 2) * bin_pow(a, x / 2)) % N;
  if (x % 2 != 0) return (bin_pow(a, x - 1) * (a % N)) % N;
}
int main() {
  cin >> n >> m;
  cout << bin_pow(bin_pow(2, m) - 1, n);
}
