n, m = [int(i) for i in input().split()]
f = [1, 1]
mod = 1000000007
# c1 = 9 * pow(4, mod - 2, mod)
# c2 = 3 * pow(2, mod - 2, mod)
for i in range(100005):
    f.append((f[-1] + f[-2])%mod)

# # # print(f[:20])

# if n < 3 or m < 3:
#     if n < m:
#         n, m = m, n
#     if m == 1:
#         ans = 2 * f[n]
#     else:
#         ans = 2 + 2 * f[n]
    
# elif n & 1:
#     1+''
#     n, m = m, n

#     ans = pow(2 * f[n-1], m//2 - 1, mod) * pow(2 * f[n+1], 2, mod) * pow(2, m//2 - 2, mod)
    
# else:
#     M = n // 2 - 1
#     l = m - 1
#     1 + ''
#     ans = pow(2, M+1, mod) * c2 * pow(f[l], M, mod) * (2 + 2*f[l+1])


ans2 = 2*f[m] + 2*f[n] - 2

# print(ans%mod)
print(ans2%mod)


