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 long long MOD = 1e9 + 7;
const int maxN = 5005;
long long c[maxN][maxN];
long long coef[maxN], coef2[maxN];
long long mypower(long long a, long long b) {
  if (b == 0) return 1;
  long long ans = mypower(a, b / 2);
  ans = (ans * ans) % MOD;
  if (b & 1) ans = (ans * a) % MOD;
  return ans;
}
void solveTask() {
  for (int i = 0; i < maxN; ++i) {
    for (int j = 0; j < maxN; ++j) {
      if (i < j)
        c[i][j] = 0;
      else if (i == j || j == 0)
        c[i][j] = 1;
      else
        c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
      if (c[i][j] >= MOD) c[i][j] -= MOD;
    }
  }
  int n, k;
  cin >> n >> k;
  if (n <= k) {
    long long answer = 0;
    for (int i = 1; i <= n; ++i) {
      answer = (answer + c[n][i] * mypower(i, k)) % MOD;
    }
    cout << answer << endl;
    return;
  } else {
    coef[0] = 1;
    for (int i = 1; i <= k; ++i) {
      for (int j = 0; j <= k; ++j) {
        coef2[j] = coef2[j] + coef[j] * (n - i + 1);
        coef2[j] %= MOD;
      }
      for (int j = 1; j <= k; ++j) {
        long long cur = (coef[j] * j) % MOD;
        coef2[j] = (coef2[j] + cur) % MOD;
        coef2[j - 1] = (coef2[j - 1] + cur) % MOD;
      }
      for (int j = 0; j <= k; ++j) {
        coef[j] = 0;
      }
      for (int j = 0; j <= k; ++j) {
        if (i != k) {
          if (j)
            coef[j] = coef2[j - 1];
          else
            coef[j] = 0;
        } else
          coef[j] = coef2[j];
      }
      for (int j = 0; j <= k; ++j) coef2[j] = 0;
    }
  }
  long long answer = mypower(2, n - k);
  long long sum = 0;
  for (int i = 0; i <= k; ++i) {
    sum += coef[i];
    sum %= MOD;
  }
  cout << (answer * sum) % MOD;
}
int main() {
  ios_base::sync_with_stdio(false);
  solveTask();
  return 0;
}
