import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.util.Arrays;
 
public class Solution {
	public static void main(String[] args) throws IOException {
	    // Read inputs
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int m = Integer.parseInt(st.nextToken());
		
		// Wlog n > m
		if(n< m){
		    int temp = m;
		    m = n;
		    n = temp;
		}
		long[] dp = new long[n];
		dp[0] = 1;
		if(n<2){
		    System.out.println(2);
		    return;
		}
		dp[1] = 2;
		for(int i = 2; i< n; i++){
		    dp[i] = (dp[i-1] + dp[i-2]) % (1000000000+7);
		}
		long ans = ((dp[n-1] * 2)% (1000000000+7)) + ((dp[m-1] * 2)% (1000000000+7)) - 2;
		
	    System.out.println(ans % (1000000000+7));
	}
}