import java.util.*;
import java.io.*;

public class ProbTheory {
    final static long MODULO = (long)(1e9+7);
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //StringTokenizer st = new StringTokenizer(br.readLine());
        //PrintWriter pw = new PrintWriter("ProbTheory.out");

        int n = sc.nextInt();
        int m = sc.nextInt();

        long a = 1;
        long b = 1;
        long ans = 1;
        long endAns = 0;

        for(int i = 1; i<=Math.max(n,m); i++){
            if(i == n && n == m){
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
            }
            else if (i == m && m == n){
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
            }
            else if(i == n || i == m){
                endAns = ((endAns % MODULO) + (ans % MODULO)) % MODULO;
            }
            ans = ((a % MODULO) + (b % MODULO)) % MODULO;
            a = b;
            b = ans;
        }
        endAns--;
        endAns = ((endAns % MODULO) * 2) % MODULO;

        System.out.println(endAns);

    }
}