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

public class Main {
    static int tenRaised9Plus7=1000000007;
    static int tenRaised6Plus3=1000003;
    static double tenRaisedMinus6=0.000001;
    // static long INF=1000000000000000L;
    static final String[] EMPTY_ARRAY = new String[0];
    // static String unixFileLoc="/home/brijesh/Downloads/";
    // static String winFileLoc="C:\\Users\\Brijesh\\Downloads\\";
    public static void main (final String[] args) throws Exception{
        // BufferedReader br=new BufferedReader(new FileReader(d_loc+"A-small-attempt0.in"));
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st;
        StringBuilder sb = new StringBuilder();

        // code starts below

        st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());

        long[] fib = new long[m+n+1];
        fib[0] = 0;
        fib[1] = 1;
        for(int i = 2; i <= m+n; i++) {
            fib[i] = fib[i-1]+fib[i-2];
            fib[i] %= tenRaised9Plus7;
        }

        long ans = (2 * (fib[n+1] + fib[m+1] - 1)) % tenRaised9Plus7;


        System.out.println((int) ans);

    }
}