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;
void pv(vector<long long int> arr, long long int size) {
  for (long long int i = 0; i < size; i++) {
    cout << arr[i] << ' ';
  }
}
void gv(vector<long long int> &arr) {
  long long int size = arr.size();
  for (long long int i = 0; i < size; i++) {
    cin >> arr[i];
  }
}
long long int power(long long int x, long long int y) {
  if (y <= 0) return 1;
  long long int a = 1;
  x = x % 1000000007;
  while (y > 0) {
    if (y % 2 == 1) a = (a * x) % 1000000007;
    y /= 2;
    x = (x * x) % 1000000007;
  }
  return a % 1000000007;
}
long long int mult(long long int x, long long int y) {
  if (y == 0 || x == 0) return 0;
  if (y == 1) return x;
  long long int g;
  if (y % 2 == 1)
    g = x;
  else
    g = 0;
  return (2 * mult(x, y / 2) + g) % 1000000007;
}
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, k;
  cin >> n >> k;
  vector<long long int> dp1(k + 1, 0);
  long long int c = 1;
  for (long long int i = 0; i < k; i++) {
    vector<long long int> dp2(k + 1, 0);
    for (long long int j = 0; j <= i; j++) {
      if (j == i || j == 0) {
        dp2[j] = 1;
      } else {
        dp2[j] = ((dp1[j] * (j + 1)) % 1000000007 + dp1[j - 1]) % 1000000007;
      }
    }
    dp1 = dp2;
  }
  long long int s = 0;
  long long int v = 1;
  for (long long int i = 0; i <= min(k, n); i++) {
    v = mult(v, n - i);
    long long int x = mult(dp1[i], mult(v, power(2, n - i - 1)));
    s = (s + x) % 1000000007;
  }
  cout << s % 1000000007;
  return 0;
}
