import sys
MOD = 1000000000 + 7


class Solver:
    def __init__(self) -> None:
        self.n = 0
        self.m = 0

    def read_input(self) -> None:
        self.n, self.m = map(int, input().split())

    def solve(self) -> None:
        dp = [[[0] * (self.m + 1) for _ in range(2)] for _ in range(2)]

        prev = 0
        cur = 1

        dp[prev][0][0] = 1
        dp[prev][1][0] = 1

        for _ in range(1, self.n + 1):
            # clear current layer
            for j in range(2):
                for k in range(self.m + 1):
                    dp[cur][j][k] = 0

            for j in range(2):
                # Start a new run of j
                for l in range(self.m + 1):
                    dp[cur][j][1] += dp[prev][1 - j][l]
                    dp[cur][j][1] %= MOD

                # Extend existing run
                for k in range(2, self.m + 1):
                    dp[cur][j][k] = dp[prev][j][k - 1]
                    dp[cur][j][k] %= MOD

            cur, prev = prev, cur

        ans = 0

        for j in range(2):
            for k in range(1, self.m + 1):
                ans += dp[prev][j][k]
                ans %= MOD

        print(ans)

    def recurse(self, dp: list[list[list[int]]], i: int, j: int, k: int) -> int:
        if i == 0:
            dp[i][j][k] = 1 if k == 0 else 0
        elif i == 1:
            dp[i][j][k] = 1 if k == 1 else 0

        if dp[i][j][k] != -1:
            return dp[i][j][k]

        ans = 0
        if k > 1:
            ans = self.recurse(dp, i-1, j, k-1)
            ans %= MOD
        else:
            for l in range(1, self.m+1):
                ans += self.recurse(dp, i-1, 1-j, l)
                ans %= MOD

        dp[i][j][k] = ans
        return ans


def main() -> None:
    solver = Solver()
    solver.read_input()
    solver.solve()


if __name__ == "__main__":
    sys.setrecursionlimit(10**7)
    main()
