from sys import stdin, stdout

def scal(typ=int):
  return typ(stdin.readline())

def vec(typ=int):
  if isinstance(typ, list):
    inp = stdin.readline().split()
    return [typ[i](inp[i]) for i in range(len(inp))]
  else:
    return list(map(typ, stdin.readline().split()))

n, m = vec()
p = 1000000007

a, b, res = 0, 1, 0
for i in range(1, max(m, n) + 1):
  a, b = b, (a + b) % p
  if i  == m:
    res = (res + b) % p
  if i == n:
    res = (res + b) % p
res -= 1
if res < 0: res += p
res = res % p
res =  (2 * res) % p
print(res)
