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;
long long power(long long base, long long exp, long long p) {
  base %= p;
  long long res = 1;
  while (exp > 0) {
    if (exp % 2 == 1) res = (res * base) % p;
    base = (base * base) % p;
    exp /= 2;
  }
  return res % p;
}
std::vector<std::vector<long long> > sn(5010, std::vector<long long>(5010, 0));
void pre() {
  for (long long n = 1; n < 5010; n++) {
    sn[n][1] = 1;
    for (long long k = 2; k <= n; k++) {
      sn[n][k] = (sn[n - 1][k - 1] + k * sn[n - 1][k]) % 1000000007;
    }
  }
}
void solve() {
  long long n, k;
  cin >> n >> k;
  long long ans = 0, c = 1;
  for (long long i = 1; i <= min(n, k); i++) {
    long long x = power(2, n - i, 1000000007);
    c = (c * (n - i + 1)) % 1000000007;
    x = (x * c) % 1000000007;
    x = (x * sn[k][i]) % 1000000007;
    ans = (ans + x) % 1000000007;
  }
  cout << ans << "\n";
}
int main() {
  cin.sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  pre();
  long long t = 1;
  while (t--) solve();
}
