#include <bits/stdc++.h>

using namespace std;
#define int long long
const int MOD = 1000000007;
void add(int &a, const int &b) {
	a += b;
	if (a >= MOD) a -= MOD;
}
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N, M;
	cin >> N >> M;
	vector<vector<int> > dp(N + 1, vector<int>(M + 1, 0));
	for (int j = 0; j <= M; j++) {
		dp[0][j] = 1;
	}
	for (int i = 1; i <= N; i++) {
		int cur = 0;
		for (int j = 0; j <= M; j++) {
			add(dp[i][j], cur);
			add(dp[i][j], (j + 1) * dp[i - 1][j] % MOD);
			cur *= 2;
			cur += j * dp[i - 1][j];
			cur %= MOD;
		}
	}
	cout << dp[N][M] << endl;
}