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;
const int K = 5e3 + 5, MOD = 1e9 + 7;
int n, k, s2[K][K], fac1[K], fac2[K], inv[K], ans;
inline void inc(int &a, int b) { (a += b) >= MOD ? a -= MOD : a; }
inline int qsm(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = 1ll * ans * a % MOD;
    a = 1ll * a * a % MOD;
    b >>= 1;
  }
  return ans;
}
inline int C(int j) {
  return j < 0 || j > n ? 0 : 1ll * fac1[j] * inv[j] % MOD;
}
int main() {
  cin >> n >> k;
  fac1[0] = 1;
  for (register int i = 1; i <= k; ++i)
    fac1[i] = 1ll * fac1[i - 1] * (n - i + 1) % MOD;
  fac2[0] = 1;
  for (register int i = 1; i <= k; ++i) fac2[i] = 1ll * fac2[i - 1] * i % MOD;
  inv[k] = qsm(fac2[k], MOD - 2);
  for (register int i = k - 1; i >= 0; --i)
    inv[i] = 1ll * inv[i + 1] * (i + 1) % MOD;
  if (n <= k) {
    for (register int i = 0; i <= n; ++i)
      inc(ans, 1ll * C(i) * qsm(i, k) % MOD);
    return printf("%d\n", ans), 0;
  }
  s2[0][0] = 1;
  for (register int i = 1; i <= k; ++i)
    for (register int j = 1; j <= i; ++j)
      s2[i][j] = s2[i - 1][j - 1], inc(s2[i][j], 1ll * s2[i - 1][j] * j % MOD);
  for (register int i = 0; i <= k; ++i)
    inc(ans, 1ll * fac2[i] * C(i) % MOD * s2[k][i] % MOD * qsm(2, n - i) % MOD);
  printf("%d\n", ans);
  return 0;
}
