MOD = 10 ** 9 + 7

def get(t, n):
    if n == 1:
        return t

    a, b = t, 2 * t

    for i in range(n - 2):
        a, b = b, (a + b) % MOD

    return b


n, m = map(int, input().split())

ans = 0
ans += get(2, n)
ans += get(2, m)
ans -= 2

print(ans % MOD)
