n, m = map(int, input().split())
modulo = 10 ** 9 + 7
combs = 0
r = 1
r_next = 2
a = min(n, m)
b = max(n, m)
for i in range(3, a + 1):
    r, r_next = r_next, (r + r_next) % modulo
combs += r_next if a > 1 else 1
for i in range(max(3, a + 1), b + 1):
    r, r_next = r_next, (r + r_next) % modulo
combs += r_next if b > 1 else 1
combs -= 1
combs *= 2
print(combs % modulo)