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

public class tank {

    static final FastScanner fs = new FastScanner();

    //static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        int t = 1;
        while(t-->0) {
            run_case();
        }

        //out.close();
    }

    static void run_case() {
        int n = fs.nextInt(), m = fs.nextInt();
        long mod = 1000_000_007, ans;
        long[] dpn = new long[n+1];
        dpn[1] = 1;

        if(n > 1) {
            dpn[2] = 2;

            for (int i = 3; i <= n; i++) {
                dpn[i] = (dpn[i - 1] + dpn[i - 2]) % mod;
            }
        }

        ans = (2 * dpn[n]) % mod;

        dpn = new long[m+1];
        dpn[1] = 1;

        if(m > 1) {
            dpn[2] = 2;

            for (int i = 3; i <= m; i++) {
                dpn[i] = (dpn[i - 1] + dpn[i - 2]) % mod;
            }
        }

        ans = (2 * dpn[m] + ans) % mod;

        System.out.println((ans - 2 + mod) % mod);
    }

    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        String nextLine(){
            try {
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }

            return "";
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}
