n, m = list(map(int, input().split()))
max_element = max(n, m)
min_element = min(n, m)
dp = [2 for i in range(max_element+1)]
for i in range(2, max_element + 1):
    dp[i] = dp[i - 1] + dp[i - 2]
print((dp[max_element] + dp[min_element] - 2) % (10 ** 9 + 7))