import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class test3 {
    static long mod=1000000007l;
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine()," ");
        int n=Integer.parseInt(st.nextToken());
        int m=Integer.parseInt(st.nextToken());
        long a=0,b=2;
        long len=0;
        for (int i = 1; i <= n; i++) {
            len=a+b;
            a=b;
            b=len;
            len=len%mod;
            a=a%mod;
            b=b%mod;
        }
        long ans=len;
        a=0;
        b=2;
        len=0;
        for (int i = 1; i <= m; i++) {
            ans+=a;
            len=a+b;
            a=b;
            b=len;
            len=len%mod;
            a=a%mod;
            b=b%mod;
            ans=ans%mod;
        }
        System.out.println(ans);
    }
}
