import java.io.*;
import java.util.StringTokenizer;
public class CF1239A {
    static int MOD=1000000007;
    public static void main(String[] args) throws IOException {
         long[] fib=new long[1000001];
         fib[0]=1;
         fib[1]=2;
         fib[2]=3;
         for (int i = 3; i < 1000001; i++) {
            fib[i]=(fib[i-1]+fib[i-2])%MOD;
        }
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());
        
        int M=Integer.parseInt(st.nextToken());
        int N=Integer.parseInt(st.nextToken());
        int ans=2;
        for (int i = 0; i <= N-3; i++) {
            ans+=fib[i]; ans%=MOD;
        }
        for (int i = 0; i <= M-3; i++) {
            ans+=fib[i]; ans%=MOD;
        }
        ans*=2; ans%=MOD; ans+=2; ans%=MOD;
        System.out.println(ans);
    }
    
}
