You have a team of N people. For a particular task, you can pick any non-empty subset of people. The cost of having x people for the task is xk. 

Output the sum of costs over all non-empty subsets of people.

Input

Only line of input contains two integers N (1 ≤ N ≤ 109) representing total number of people and k (1 ≤ k ≤ 5000).

Output

Output the sum of costs for all non empty subsets modulo 109 + 7.

Examples

Input

1 1


Output

1


Input

3 2


Output

24

Note

In the first example, there is only one non-empty subset {1} with cost 11 = 1.

In the second example, there are seven non-empty subsets.

- {1} with cost 12 = 1

- {2} with cost 12 = 1

- {1, 2} with cost 22 = 4

- {3} with cost 12 = 1

- {1, 3} with cost 22 = 4

- {2, 3} with cost 22 = 4

- {1, 2, 3} with cost 32 = 9

The total cost is 1 + 1 + 4 + 1 + 4 + 4 + 9 = 24.
import java.util.*;
import java.math.*;
import java.io.*;

public class CF932E {

	// So I had the basic idea where it is the sum(i=1...n){(n choose i) * i^k}
	// I had to make an observation about the binomial expansion of (x + 1)^n
	// since (x + 1)^n = sum(i=1...n){(n choose i) * x^i}

	static final int MOD = (int) 1e9 + 7;
	static long[][] dp;
	static int n, k;
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt(); k = scan.nextInt();
		dp = new long[5010][5010];
		for(int i = 0 ; i < 5000 ; i++)
			Arrays.fill(dp[i], -1);
		System.out.println(ddx(0, n, k));
	}

	// ddx(x power, binomial power, k)
	// x power is a pointless state in the dp, but is helpful to pass in the function
	static long ddx(int xp, int bp, int k) {

		if(k == 0)
			return modExp(2, bp, MOD);

		if(dp[n-bp][k] != -1)
			return dp[n-bp][k];

		long res = 0;

		res = (res + (ddx(xp, bp, k - 1) * xp)) % MOD;
		res = (res + (ddx(xp + 1, Math.max(0, bp - 1), k - 1) * bp)) % MOD;
		
		dp[n-bp][k] = res;
		return res;
	}
	
	static long modExp(long b, long e, int MOD) {
		if(e == 0)
			return 1L;
		if(e % 2 == 0) {
			long sqrt = modExp(b, e / 2, MOD);
			return (sqrt * sqrt) % MOD;
		}
		return (b * modExp(b, e - 1, MOD));
	}
}
