mod = 10**9 + 7

n, m = map(int, raw_input().strip().split())
if n > m:
    n, m = m, n

a = [0 for i in range(m + 5)]
a[0] = 1
a[1] = 1
for i in range(2, m + 5):
    a[i] = a[i - 1] + a[i - 2]
    a[i] %= mod
res = 2 * a[m] + 2 * (n - 1)
print res % mod
