#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')
fact = [i for i in range(10**5+1)]
fact[0] = 1
for i in range(10**5):
  fact[i+1]*=fact[i]
  fact[i+1]%=mod
invfact=[None]*(10**5+1)
invfact[-1]=pow(fact[-1],mod-2,mod)
for i in range(10**5):
  invfact[-i-2]=(invfact[-i-1]*(10**5-i))%mod

def cmb(n,k):
  return fact[n]*invfact[k]*invfact[n-k]%mod
#solve
def solve():
    n, m = LI()
    dp = [[0, 0] for i in range(n + 1)]
    dp[0][0] = 1
    dp[1][0] = n
    dp[1][1] = n
    for i in range(1,n):
        dp[i + 1][0] = cmb(n,i)
        dp[i + 1][1] = cmb(n,i)*(i+1)%mod
    ans = pow(2, m, mod)
    tmp = 0
    for d1, d2 in dp:
        tmp += d1 + d2
        tmp %= mod
    print(ans * tmp % mod)
    return


#main
if __name__ == '__main__':
    solve()