#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int mod=1000000007;
inline void add(int &x,int y){(x+=y)>=mod?x-=mod:0;}
inline int pl(int x,int y){return (x+=y)>=mod?x-mod:x;}
int n,m,dp[5050],po[5050],ipo[5050];
int main()
{
	scanf("%d %d",&n,&m);
	po[0]=1;ipo[0]=1;
	for(int i=1;i<=m;++i)po[i]=2*po[i-1]%mod,ipo[i]=500000004ll*ipo[i-1]%mod;
	for(int i=1;i<=m;++i)dp[i]=1;
	for(int i=1;i<=n;++i)
	{
		int sum=0,tmp;
		for(int j=1;j<=m;++j)
		{
			tmp=dp[j];
			dp[j]=(1ll*dp[j]*(j+1)+1ll*sum*po[j-1])%mod;
			sum=(sum+1ll*tmp*j%mod*ipo[j])%mod;
		}
	}
	printf("%d",dp[m]);
	return 0;
}