#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
ll mod = 1000000007;
ll dp[5555][5555];
ll zdp[5555];
ll p2[5555], ip2[5555];
int main()
{
	int hei, len;
	scanf("%d%d", &hei, &len);
	p2[0] = ip2[0] = 1;
	for (int i = 1; i <= 5050; i++)p2[i] = p2[i - 1] * 2 % mod, ip2[i] = ip2[i - 1] * ((mod + 1) / 2) % mod;
	dp[0][len] = 1;
	for (int i = 0; i < hei; i++)
	{
		for (int j = 1; j <= len; j++)zdp[j] = dp[i][j] * p2[j] % mod;
		for (int j = 1; j <= len; j++)zdp[j] = (zdp[j] + zdp[j - 1]) % mod;
		for (int j = 1; j <= len; j++)dp[i + 1][j] = (zdp[len] + mod - zdp[j])*ip2[j + 1] % mod*j%mod;
		for (int j = 1; j <= len; j++)dp[i + 1][j] = (dp[i + 1][j] + dp[i][j] * (j + 1)) % mod;
		//for (int j = 1; j <= len; j++)printf("%lld ", dp[i + 1][j]); printf("\n");
	}
	ll r = 0;
	for (int i = 1; i <= len; i++)r = (r + dp[hei][i]) % mod;
	printf("%lld\n", r);
}