class ModComb:
    def __init__(self, MAX, mod=10 ** 9 + 7):
        fac = [1, 1]
        finv = [1, 1]
        inv = [0, 1]
        for i in range(2, MAX):
            fac.append(fac[i - 1] * i % mod)
            inv.append(mod - inv[mod % i] * (mod // i) % mod)
            finv.append(finv[i - 1] * inv[i] % mod)
        self.fac, self.finv, self.mod = fac, finv, mod

    def nCk(self, n, k):
        if n < k or n < 0 or k < 0:
            return 0
        fac, finv, mod = self.fac, self.finv, self.mod
        return fac[n] * (finv[k] * finv[n - k] % mod) % mod

def main():

    mod = 10 ** 9 + 7

    mc = ModComb(10 ** 5 + 7)

    N, M = map(int, input().split())

    ans = 0
    for i in range(1, N):
        ans += mc.nCk(N - i, i) % mod
    for i in range(1, M):
        ans += mc.nCk(M - i, i) % mod

    print((ans + 1) * 2 % mod)


if __name__ == '__main__':
    main()
