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;
long long int f[5011], inv[5011];
long long int exp(long long int a, long long int b) {
  long long int r = 1;
  while (b) {
    if (b & 1) r = r * a % 1000000007, r %= 1000000007;
    a = a * a % 1000000007;
    b /= 2;
  }
  return r % 1000000007;
}
void prec() {
  int i, j;
  f[0] = inv[0] = 1;
  for (i = 1; i < 5011; ++i) {
    f[i] = f[i - 1] * i % 1000000007;
    f[i] %= 1000000007;
    inv[i] = inv[i - 1] * exp(i, 1000000007 - 2) % 1000000007;
    inv[i] %= 1000000007;
  }
}
long long int chose(long long int n, long long int k) {
  if (n < k) return 0;
  long long int r = f[n];
  r = r * inv[k];
  r %= 1000000007;
  r = r * inv[n - k];
  return r % 1000000007;
}
long long int dp[5011][5011];
long long int fo(long long int n, long long int k) {
  if (n == 0 && k == 0) return 1;
  if (n == 0 || k == 0) return 0;
  if (dp[n][k] != -1) return dp[n][k];
  long long int ans = 0;
  ans = fo(n - 1, k - 1);
  ans %= 1000000007;
  ans = ans + k * fo(n - 1, k) % 1000000007;
  ans %= 1000000007;
  dp[n][k] = ans;
  return ans;
}
long long int sol(long long int n, long long int i) {
  if (i == 0) return exp(2, n);
  if (n == 0) return 0;
  if (i > n) return 0;
  long long int p = 1;
  for (long long int j = n; j >= 1 && j >= n - i + 1; --j)
    p = p * j, p %= 1000000007;
  p = p * exp(2, max(0ll, n - i));
  return p % 1000000007;
}
int solve() {
  long long int n, i, j, k, m, x;
  cin >> n >> k;
  long long int p = 0;
  for (i = 0; i <= k; ++i) {
    x = fo(k, i);
    x = x * sol(n, i);
    x %= 1000000007;
    p += x;
    p %= 1000000007;
  }
  cout << (p + 1000000007) % 1000000007 << "\n";
  return 0;
  ;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  prec();
  memset(dp, -1, sizeof(dp));
  while (t--) {
    solve();
  }
  return 0;
  ;
}