n, m = map(int, input().split())
mod = 1000000007
record = {}


a, b = 1, 1
for d in range(max(n, m)+1):
    # a, b = b, a+b
    a, b = b % mod, a+b
    record[d+1] = a

ans = record[n]+record[m]-1
print(ans*2 % mod)

  	  	 	  				  	 	 	 		   			