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;
vector<vector<long long int> > dp(5009, vector<long long int>(5009, 0));
long long int modexpo(long long int base, long long int expo,
                      long long int mod) {
  long long int result = 1;
  while (expo > 0) {
    if (expo & 1) result = (result * base) % mod;
    base = (base * base) % mod;
    expo = expo >> 1;
  }
  return result;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, k;
  cin >> n >> k;
  dp[1][1] = 1;
  for (long long int i = 2; i <= 5000; i++) {
    for (long long int j = 1; j <= 5000; j++) {
      dp[i][j] =
          ((dp[i - 1][j] * j) % 1000000007 + dp[i - 1][j - 1] + 1000000007) %
          1000000007;
    }
  }
  long long int tp = 1;
  long long int ans = 0;
  for (long long int j = 1; j <= k; j++) {
    tp = ((tp * (n - j + 1)) % 1000000007 + 1000000007) % 1000000007;
    dp[k][j] = ((dp[k][j] * tp) % 1000000007 + 1000000007) % 1000000007;
    dp[k][j] = (((dp[k][j] * modexpo(2, n - j, 1000000007)) % 1000000007) +
                1000000007) %
               1000000007;
    ans = ((ans + dp[k][j]) % 1000000007 + 1000000007) % 1000000007;
  }
  cout << ans;
  return 0;
  cout << endl;
  tp = modexpo(2, n - k, 1000000007);
  for (int j = k; j >= 1; j--) {
    dp[k][j] = ((dp[k][j] * tp) % 1000000007 + 1000000007) % 1000000007;
    ans = ((ans + dp[k][j]) % 1000000007 + 1000000007) % 1000000007;
    tp = ((2 * tp) % 1000000007 + 1000000007) % 1000000007;
  }
  cout << endl;
  cout << ans;
  return 0;
}