
import java.io.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*; 
import java.util.LinkedList; 

public class Main {
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
		String[] cmd=br.readLine().split(" ");
		int n=Integer.valueOf(cmd[0]);
		int m=Integer.valueOf(cmd[1]);
		long a=0;
		long b=2;
		long ans1=0;
		long ans2=0;
		long mod=1000000007;
		for(int i=1;i<=n;i++)
		{
			ans1=(a+b)%mod;
			a=b;
			b=ans1;
		}
		a=0;
		b=2;
		for(int i=1;i<=m;i++)
		{
			ans2=(a+b)%mod;
			a=b;
			b=ans2;
		}
		System.out.println((ans1+ans2-2)%mod);
	}
}
