#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
template <typename T>
using vv = vector<vector<T>>;
template <typename T>
using pp = pair<T, T>;
const long long MOD = 1e9 + 7;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  long long y = max(n, m);
  long long ans = 1;
  for (long long i = 0; i < y; ++i) ans = ans * 2 % MOD;
  cout << ans;
  return 0;
}
