Problem: 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.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int P = 1e9 + 7, INF = 0x3f3f3f3f;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long qpow(long long a, long long n) {
  long long r = 1 % P;
  for (a %= P; n; a = a * a % P, n >>= 1)
    if (n & 1) r = r * a % P;
  return r;
}
long long inv(long long first) {
  return first <= 1 ? 1 : inv(P % first) * (P - P / first) % P;
}
inline int rd() {
  int first = 0;
  char p = getchar();
  while (p < '0' || p > '9') p = getchar();
  while (p >= '0' && p <= '9') first = first * 10 + p - '0', p = getchar();
  return first;
}
const int N = 1e6 + 10;
int n, k, fac[N], ifac[N], S[5050][5050];
int C(int n, int m) {
  return (long long)fac[n] * ifac[n - m] % P * ifac[m] % P;
}
int a[] = {
    1,         682498929, 491101308, 76479948,  723816384, 67347853,  27368307,
    625544428, 199888908, 888050723, 927880474, 281863274, 661224977, 623534362,
    970055531, 261384175, 195888993, 66404266,  547665832, 109838563, 933245637,
    724691727, 368925948, 268838846, 136026497, 112390913, 135498044, 217544623,
    419363534, 500780548, 668123525, 128487469, 30977140,  522049725, 309058615,
    386027524, 189239124, 148528617, 940567523, 917084264, 429277690, 996164327,
    358655417, 568392357, 780072518, 462639908, 275105629, 909210595, 99199382,
    703397904, 733333339, 97830135,  608823837, 256141983, 141827977, 696628828,
    637939935, 811575797, 848924691, 131772368, 724464507, 272814771, 326159309,
    456152084, 903466878, 92255682,  769795511, 373745190, 606241871, 825871994,
    957939114, 435887178, 852304035, 663307737, 375297772, 217598709, 624148346,
    671734977, 624500515, 748510389, 203191898, 423951674, 629786193, 672850561,
    814362881, 823845496, 116667533, 256473217, 627655552, 245795606, 586445753,
    172114298, 193781724, 778983779, 83868974,  315103615, 965785236, 492741665,
    377329025, 847549272, 698611116};
int solve(int n) {
  if (n < N) return fac[n];
  int first = n / 10000000, second = first * 10000000 + 1;
  long long ans = a[first];
  for (int i = second; i <= n; ++i) ans = ans * i % P;
  return ans;
}
int main() {
  fac[0] = ifac[0] = 1;
  for (int i = 1; i <= N - 1; ++i) fac[i] = (long long)fac[i - 1] * i % P;
  ifac[N - 1] = inv(fac[N - 1]);
  for (int i = N - 2; i >= 0; --i)
    ifac[i] = (long long)ifac[i + 1] * (i + 1) % P;
  scanf("%d%d", &n, &k);
  S[0][0] = 1;
  for (int i = 1; i <= k; ++i) {
    for (int j = 1; j <= i; ++j)
      S[i][j] = (S[i - 1][j - 1] + (long long)j * S[i - 1][j]) % P;
  }
  if (n <= k) {
    int ans = 0;
    for (int i = 0; i <= n; ++i) ans = (ans + C(n, i) * qpow(i, k)) % P;
    printf("%d\n", ans);
    return 0;
  }
  int ans = 0, w = solve(n), iw = inv(w);
  for (int i = 0; i <= k; ++i) {
    ans = (ans + (long long)S[k][i] * iw % P * qpow(2, n - i)) % P;
    iw = (long long)iw * (n - i) % P;
  }
  ans = (long long)ans * w % P;
  printf("%d\n", ans);
}