#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const int P = 1e9 + 7;
inline int mpow(int a, int b) {
    int ans = 1;
    for (; b; b >>= 1, a = (ll) a * a % P)
        if (b & 1) ans = (ll) ans * a % P;
    return ans;
}
void upd(int &x, int y) { x = x + y - P; x += x >> 31 & P; }

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    vector<int> dp(m + 1, 1);
    for (int i = 1; i <= n; ++i) {
        vector<int> new_dp(m + 1);
        vector<int> sum(m + 1, 0);
        sum[0] = 0;
        for (int j = 1; j <= m; ++j) {
            sum[j] = ((ll) 2 * sum[j - 1] % P + (ll) j * dp[j] % P) % P;
            new_dp[j] = (sum[j - 1] + (ll) dp[j] * (j + 1) % P) % P;
        }
        swap(dp, new_dp);
    }
    cout << dp[m] << '\n';
    return 0;
}