#include <bits/stdc++.h>
using namespace std;
long long n, k;
long long pow(long long x) {
  long long ans = 1, base = 2;
  while (x > 0) {
    if (x & 1) ans *= base, ans %= 1000000007;
    base *= base;
    base %= 1000000007;
    x >>= 1;
  }
  return ans;
}
int main() {
  scanf("%lld %lld", &n, &k);
  if (n == 0) {
    printf("0");
    return 0;
  }
  printf(
      "%lld",
      (((pow(k) % 1000000007) * ((2 * n - 1) % 1000000007)) % 1000000007 + 1) %
          1000000007);
  return 0;
}
