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.
#include <bits/stdc++.h>
using namespace std;
long long int n, k;
long long int dp[5001][5001] = {0};
long long int p[5001] = {0};
long long int func(long long int a, long long int b) {
  if (dp[a][b] != 0) {
    return dp[a][b];
  }
  if (b == n) {
    dp[a][b] = p[a];
    return dp[a][b];
  }
  long long int r1 = func(a - 1, b + 1);
  long long int r2 = func(a - 1, b);
  dp[a][b] =
      (((n - b) * r1) % 1000000007 + (b * (r2)) % 1000000007) % 1000000007;
  return dp[a][b];
}
long long int f1(long long int y) {
  long long int res = 1, x = 2;
  while (y > 0) {
    if (y % 2 != 0) {
      res = (res * x) % 1000000007;
    }
    y = y / 2;
    x = (x * x) % 1000000007;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> k;
  long long int r = 1;
  for (long long int i = 0; i <= k; i++) {
    p[i] = r;
    r = (r * n) % 1000000007;
  }
  if (n >= k) {
    long long int exp = f1(n - k);
    for (int i = k; i >= 0; i--) {
      dp[0][i] = exp;
      exp = (exp * 2) % 1000000007;
    }
  } else {
    long long int exp = 1;
    for (int i = n; i >= 0; i--) {
      dp[0][i] = exp;
      exp = (exp * 2) % 1000000007;
    }
  }
  long long int res = func(k, 0);
  cout << dp[k][0];
  return 0;
}
