#include <cstdio>

using namespace std;

const int mod = 1000000007;

long long b[5001];
long long dp[5001][5001];

int main() {
    int n, m, i, j;
    
    scanf("%d %d", &n, &m);
    
    b[0] = 1;
    for (i = 1; i <= m; i++) b[i] = b[i - 1] * 2 % mod;
    
    for (i = 0; i <= m; i++) dp[0][i] = 1;
    
    for (i = 0; i < n; i++) {
        long long sum = 0;
        
        for (j = 0; j <= m; j++) {
            dp[i + 1][j] = (dp[i][j] * (j + 1) + sum) % mod;
            
            sum *= 2;
            sum += dp[i][j] * j;
            sum %= mod;
        }
    }
    
    printf("%lld\n", dp[n][m] % mod);
    
    return 0;
}
