
import java.util.*;


import java.io.*;

public class dp_12 {

	static Scanner sc;
	static long modpower(long x, long y, long p) 
    { 
        long res = 1; 
  
        x = x % p; 
                      
        while (y > 0) 
        { 
  
            if (y % 2 == 1) 
                res = (res * x) % p; 

            y = y >> 1; // y = y/2 
            x = (x * x) % p; 
        } 
          
        return res; 
    } 

	static void solve() {
	int mod=1000000007;
		
		int r=sc.nextInt();
		int c=sc.nextInt();
		int temp;long temp1;
		
		temp=(int)Math.max(r, c);
//		temp1=Math.min(r, c);
//		r=temp;c=temp1;
		
		if (r==1 && c==1) { System.out.println(2);return;}
		
		else {
			
		long[] fib=new long[temp+1];
		fib[0]=1;
		fib[1]=1;
		for( int i=2;i<=temp;i++) {
			fib[i]=(fib[i-1]%mod+fib[i-2]%mod)%mod;
		}
		System.out.println((2*(fib[r]+fib[c]-1))%mod);
		}

	}

	public static void main(String[] args) throws Exception {
		sc = new Scanner(System.in);
		int q = 1;
		
		while (q-- > 0) solve();
	}
} 