n, m = [int(x) for x in input().split()]
Fib = [0 for i in range(max(n, m) + 2)]
Fib[1] = 1
for i in range(2,max(n, m) + 2):
    Fib[i] = (Fib[i - 1] + Fib[i - 2]) % 1000000007
print(((Fib[n + 1] + Fib[m + 1] - 1)*2) % 1000000007)
