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;
inline char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline int read() {
  int x = 0;
  char ch = getchar();
  bool positive = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') positive = 0;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return positive ? x : -x;
}
inline void write(int a) {
  if (a < 0) {
    a = -a;
    putchar('-');
  }
  if (a >= 10) write(a / 10);
  putchar('0' + a % 10);
}
inline void writeln(int a) {
  if (a < 0) {
    a = -a;
    putchar('-');
  }
  write(a);
  puts("");
}
inline int rnd(int x) { return rand() % x; }
inline unsigned long long rnd() {
  return ((unsigned long long)rand() << 30 ^ rand()) << 4 | rand() % 4;
}
const int N = 5005, mod = 1000000007, C = 3;
int n, k, c[N][N], ycl[N], ni[N], arr[N], jb[N], fac[N];
inline int ksm(long long a, int b) {
  int ans = 1;
  for (; b; b >>= 1) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
  }
  return ans;
}
int qiu(int n, int x) {
  int ans = 0;
  static int f[N], g[N];
  g[n + 1] = 1;
  for (int i = 0; i <= n; i++)
    f[i] = i ? (long long)f[i - 1] * (x - i) % mod : x;
  for (int i = n; i >= 0; i--) g[i] = (long long)g[i + 1] * (x - i) % mod;
  for (int i = 0; i <= n; i++) {
    long long sum = (long long)(i ? f[i - 1] : 1) * g[i + 1] % mod *
                    ksm((long long)fac[i] * fac[n - i] % mod, mod - 2) % mod;
    if ((n - i) & 1) sum *= -1;
    ans = (ans + sum * arr[i]) % mod;
  }
  return (ans + mod) % mod;
}
int main() {
  n = read();
  k = read();
  for (int i = 0; i <= k + C; i++) {
    c[i][0] = 1;
    ycl[i] = ksm(i, k);
    ni[i] = ksm(i, mod - 2);
    jb[i] = ksm((mod + 1) / 2, i);
    fac[i] = i ? (long long)fac[i - 1] * i % mod : 1;
    for (int j = 1; j <= i; j++)
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % mod;
  }
  for (int i = 0; i <= k + C; i++) {
    for (int j = 0; j <= i; j++)
      arr[i] = (arr[i] + (long long)c[i][j] * ycl[j]) % mod;
    arr[i] = (long long)arr[i] * jb[i] % mod;
  }
  writeln((long long)qiu(k + C, n) * ksm(2, n) % mod);
}
