#include <bits/stdc++.h>
namespace Main {
namespace Source {
static inline const unsigned int qpow(unsigned int b, unsigned int e,
                                      const unsigned int mod) {
  unsigned int r(1);
  while (e) {
    if (e bitand 1) r = 1ull * r * b % mod;
    b = 1ull * b * b % mod, e >>= 1;
  }
  return r;
}
static inline const unsigned int inv(const unsigned int x,
                                     const unsigned int p) {
  return qpow(x, p - 2, p);
}
static inline const unsigned int frac(const unsigned int a,
                                      const unsigned int b,
                                      const unsigned int p) {
  return 1ull * a * inv(b, p) % p;
}
}  // namespace Source
using namespace Source;
static const unsigned int Mod(1e9 + 7);
static unsigned int n, m;
static unsigned int ans;
static inline const void main() {
  scanf("%u%u", &n, &m);
  printf("%u\n", ans = 1ull * qpow((n + 1) * 2, m, Mod) *
                       frac(n + 1 - m, n + 1, Mod) % Mod);
}
}  // namespace Main
signed int main() {
  Main::main();
  return 0;
}
