from sys import stdin

n, m = [int(i) for i in stdin.readline().strip().split()]

s = min(n, m)
t = max(n, m)

# colorize block of size 1 * t
c = (t + 1) * [2]  # number of colorings for block 1 * i
for i in range(2, t + 1):
    c[i] = c[i - 1] + c[i - 2]

# minus two blocks of alternating coloring, because they are counted twice
res = c[t] + c[s] - 2
print(res % (10 ** 9 + 7))
