#include <bits/stdc++.h>
using namespace std;
vector<pair<int, pair<int, int>>> cur, nxt;
int m[100000];
int mul(int a, int b) {
  int y = (a * 1LL * b) % 1000000007;
  return y;
}
int powmod(int a, int b) {
  if (b == 0) return 1;
  if (b & 1) return mul(a, powmod(a, b - 1));
  return powmod(mul(a, a), (b >> 1));
}
void diff(int n) {
  nxt.clear();
  int minidx = n + 1, maxidx = -1;
  for (int i = 0; i < cur.size(); ++i) {
    minidx = min(minidx, cur[i].second.first - 1);
    maxidx = max(maxidx, cur[i].second.first);
    m[(cur[i].second.first - 1)] +=
        (cur[i].first * 1LL * cur[i].second.first) % 1000000007;
    if (m[(cur[i].second.first - 1)] >= 1000000007)
      m[(cur[i].second.first - 1)] -= 1000000007;
    m[(cur[i].second.first)] +=
        (cur[i].first * 1LL * cur[i].second.second) % 1000000007;
    if (m[(cur[i].second.first)] >= 1000000007)
      m[(cur[i].second.first)] -= 1000000007;
  }
  for (int i = minidx; i <= maxidx; ++i) {
    if (m[i]) nxt.push_back({m[i], {i + 1, n - i - 1}});
    m[i] = 0;
  }
  cur.swap(nxt);
}
signed main() {
  int n, k;
  scanf("%d", &n);
  scanf("%d", &k);
  cur.push_back({1, {0, n}});
  while (k--) {
    diff(n);
  }
  int ans = 0;
  for (int i = 0; i < cur.size(); ++i) {
    ans += mul(cur[i].first, powmod(2, cur[i].second.second));
    if (ans >= 1000000007) ans -= 1000000007;
  }
  printf("%d\n", ans);
  return 0;
}
