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

public class Abc {
    public static void main(String[] args) throws Exception {
        FastReader sc = new FastReader();
        int mod=1000000007;
        int n=sc.nextInt(),m=sc.nextInt();
        int max=Math.max(n,m)+1;
        long f[]=new long[max];
        f[1]=f[0]=1;
        for (int i=2;i<max;i++){
            f[i]=(f[i-1]+f[i-2])%mod;
        }
//        System.out.println(f[2]+" "+f[3]);
        System.out.println((2*(f[m]+f[n]-1))%mod);

    }
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

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