import java.util.Scanner;

public class Ivan_The_Fool_And_The_Probability_Theory {

	public static void main(String[] args) {
     Scanner scn=new Scanner(System.in);
     int n=scn.nextInt();
     int m=scn.nextInt();
    int max=Math.max(n,m)+1;
    long []arr=new long[max];
    arr[0]=1;
    arr[1]=1;
    long mod=1000000007;
    for(int i=2;i<max;i++) {
    	arr[i]=(arr[i-1]+arr[i-2])%mod;
    }
    System.out.println((2*1L*(arr[n]+arr[m]-1L+mod))%mod);
	}

}
