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


public class Main {
    static int i,j,k,n,m,t,x,y,max=1000000;
    static long ans,a,b,c,d,l,r,mod=1000000007;
    static String str;
    static char ch;
    static FastScanner fs = new FastScanner();



    public static void main(String[] args) {

        n = fs.nextInt();
        m = fs.nextInt();

        ans = 0;

        long[][] dp = new long[100005][2];

        dp[1][0]=1;
        dp[2][0]=1;
        dp[2][1]=1;

        j = Math.max(n,m);

        for(i=3;i<=j;i++){
            dp[i][0]=dp[i-1][0]+dp[i-1][1];
            dp[i][1]=dp[i-1][0];

            dp[i][0]%=mod;
            dp[i][1]%=mod;
        }

        ans += 2*(dp[n][0]+dp[n][1]);

        ans%=mod;

        ans+= 2*(dp[m][0]+dp[m][1]);
        ans%=mod;

        ans-=2;

        if(ans<0)
            ans+=mod;

        ans%=mod;

        System.out.println(ans);


    }


    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();
        }

        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());
        }
    }

    private static long inv( long a, long b){
        return 1<a ? b - inv(b%a,a)*b/a : 1;
    }

    //To be used with priority queues.
    static class State implements Comparable<State> {
        int l, r;
        int len;
        public State(int l, int r) {
            this.l=l;
            this.r=r;
            this.len=r-l+1;
        }

        public int compareTo(State o) {
            if (len!=o.len) {
                return -Integer.compare(len, o.len);
            }
            else {
                return Integer.compare(l, o.l);
            }
        }
    }

    static void sort(int[] a) {
        ArrayList<Integer> l=new ArrayList<>();
        for (int i:a) l.add(i);
        Collections.sort(l);
        for (int i=0; i<a.length; i++) a[i]=l.get(i);
    }

}