import java.util.*;
public class Main{
    static int mod=(int)1e9+7;
    static long[]f=new long[100005];
    public static void main(String [] args){
        Scanner scn = new Scanner(System.in);
        int n=scn.nextInt();
        int m=scn.nextInt();
        long ans=((fib(m+1)+fib(n+1))%mod-1+mod)%mod;
        // System.out.println(ans);
        ans=(2*ans)%mod;
        System.out.println(ans);
    }
    public static long fib(int n){
        
        if (n == 0) 
            return 0; 
              
        if (n == 1 || n == 2) 
            return (f[n] = 1); 

        if (f[n] != 0) 
            return f[n]; 
       
        int k = (n & 1) == 1? (n + 1) / 2 
                            : n / 2; 
        f[n] = (n & 1) == 1? ((fib(k) * fib(k))%mod +  
                        (fib(k - 1) * fib(k - 1))%mod )%mod
                       : ((((2 * fib(k - 1))%mod + fib(k))%mod)  
                       * fib(k))%mod; 
       
        return f[n]; 
    } 
    
}