/* IMPORTANT: Multiple classes and nested static classes are supported */

/*
 * uncomment this if you want to read input.
//imports for BufferedReader
import java.io.BufferedReader;
import java.io.InputStreamReader;

//import for Scanner and other utility classes
import java.util.*;
*/

// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
import java.util.*;
public class TestClass {
    public static void main(String args[] ) throws Exception {
        /* Sample code to perform I/O:
         * Use either of these methods for input

        //BufferedReader
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String name = br.readLine();                // Reading input from STDIN
        System.out.println("Hi, " + name + ".");    // Writing output to STDOUT

        //Scanner
        Scanner s = new Scanner(System.in);
        String name = s.nextLine();                 // Reading input from STDIN
        System.out.println("Hi, " + name + ".");    // Writing output to STDOUT

        */

        // Write your code here
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        long dp[][]= new long[n+m][4];
        for(int i =0;i<n+m;i++)
         for(int j =0;j<4;j++)
          dp[i][j]=-1;
        
        long val =0;  
        if(m!=1){ 
        
        
        for(int i =0;i<4;i++)
         val =(val+ cal(dp,m-2,i))%1000000007;
        }
        else
         val = 2;
        
        
        for(int i =0;i<n+m;i++)
         for(int j =0;j<4;j++)
          dp[i][j]=-1;
        
        long val1 =0;
        if(n!=1){
        for(int i =0;i<4;i++)
         val1= (val1+cal(dp,n-2,i))%1000000007;
        }
        else
         val1=2;
        val1= ((val1+val)%1000000007+1000000005)%1000000007;
        
        System.out.println(val1);
        

    }
    public static long cal(long dp[][], int n, int state)
    {
        if(n==0)
        return 1;
        long val =0;
        if(dp[n][state]!=-1)
        return dp[n][state];
        if(state==0)
        {
            val = (val+cal(dp,n-1,1))%1000000007;
        }
        else if(state==3)
         val = val+ cal(dp,n-1,2);
        else if(state==2)
        {
         val = (val + cal(dp,n-1,1))%1000000007;
         val = (val + cal(dp,n-1,0))%1000000007;
        }
        else{
            val= (val+ cal(dp,n-1,3))%1000000007;
            val = (val+cal(dp,n-1,2))%1000000007;
        }
        val= val%1000000007;
        dp[n][state]= val;
        return dp[n][state];
    }
}
