#include <bits/stdc++.h>
using namespace std;
const int Mod = 1e9 + 7;
int fastexp(int b, int p) {
  if (p == 0)
    return 1;
  else {
    int res = fastexp(b, p / 2);
    if (p % 2 == 0)
      return (1LL * res * res) % Mod;
    else
      return (((1LL * res * b) % Mod) * res) % Mod;
  }
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int val = fastexp(2, m);
  val = (val - 1) % Mod;
  int ans = fastexp(val, n);
  printf("%d\n", ans);
  return 0;
}
