
def fibonacci(n):
    a,b = 0,1
    for i in range(n):
        a,b = b,a+b
    return a

n,m=list(map(int,input().split()))

print((2*(fibonacci(m+1)+fibonacci(n+1)-1))%1000000007)

    		  					 	   		 	 	   	