class comb():
  F = [1, 1]
  Fi = [1, 1]
  I = [0, 1]
  def __init__(self, num, mod):
    self.MOD = mod
    for i in range(2, num + 1):
      self.F.append((self.F[-1] * i) % mod)
      self.I.append(mod - self.I[mod % i] * (mod // i) % mod)
      self.Fi.append(self.Fi[-1] * self.I[i] % mod)
  def com(self, n, k):
    if n < k: return 0
    if n < 0 or k < 0: return 0
    return self.F[n] * (self.Fi[k] * self.Fi[n - k] % self.MOD) % self.MOD


M, N = list(map(int, input().split()))
MOD = 10 ** 9 + 7
DP = [[[0] * 2 for i in range(M + 1)] for _ in range(N)]

com = comb(M + 1, MOD)

L = [0] * (M + 1)
for i in range(M + 1):
  L[i] = com.com(M, i)

for i in range(M + 1):
  DP[0][i][0] = 1

for i in range(1, N):
  for j in range(M + 1):
    if j != 0:
      DP[i][j][0] += (DP[i - 1][j - 1][0] + DP[i - 1][j - 1][1]) * L[j - 1] % MOD
    DP[i][j][0] += DP[i - 1][j][0] * L[j] % MOD
    DP[i][j][0] %= MOD

    if j != M:
      DP[i][j][1] += (DP[i - 1][j + 1][0]) * L[j + 1] % MOD
    DP[i][j][1] += DP[i - 1][j][1] * L[j] % MOD

ans = 0
for i in range(M + 1):
  ans = (ans + DP[-1][i][0] + DP[-1][i][1]) % MOD

print(ans)