#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long long i = 0; i < (long long)n; i++)
constexpr long long mod = 1000000007;

long long mod_pow(long long a, long long n) {
    long long ret = 1, tmp = a;
    while(n > 0) {
        if(n % 2) {
            ret *= tmp; ret %= mod;
        }
        tmp = tmp * tmp; tmp %= mod;
        n /= 2;
    }
    return ret;
}

int main() {
    int n, m;
    cin >> n >> m;
    vector<vector<long long>> dp(n, vector<long long>(m));
    rep(i, n) {
        long long sum = 0;
        rep(j, m) {
            if(i == 0) {
                dp[i][j] = mod_pow(2, j + 1);
                continue;
            }
            dp[i][j] = (((j + 2) * dp[i - 1][j]) % mod + sum) % mod;
            sum *= 2; sum %= mod;
            sum += (j + 1) * dp[i - 1][j]; sum %= mod;
        }
    }
    cout << dp[n - 1][m - 1] << endl;
    return 0;
}
