import sys

input = sys.stdin.readline


def read_i():
    return list(map(int, input().split()))


class Combinations:
    def __init__(self, max_num, mod):
        self.mod = mod
        self.factorials = [1]
        for i in range(1, max_num + 1):
            self.factorials.append((self.factorials[-1] * i) % mod)
        self.invs = [pow(self.factorials[-1], mod - 2, mod)]
        for i in reversed(range(1, max_num + 1)):
            self.invs.append(self.invs[-1] * i % mod)
        self.invs = self.invs[::-1]

    def __call__(self, n, k):
        return self.factorials[n] * self.invs[k] * self.invs[n - k] % self.mod


n, m = read_i()
MOD = 10**9 + 7
combinations = Combinations(max(n, m), MOD)
res = 0
for i in range(n // 2 + 1):
    res += combinations(n - i, i)
    res %= MOD
for i in range(m // 2 + 1):
    res += combinations(m - i, i)
    res %= MOD
res = 2 * (res - 1 + MOD) % MOD
print(res)