

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.math.BigInteger;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader sc = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, sc, out);
        out.close();
    }

    static class Task {
    	public static final long Mod=(long) (1e9+7);
    	public static final int Max=(int) 1e6;
    	
    	public long quickPow(long x,long y) {
    		long res=1;
    		
    		while(y>0) {
    			if((y&1)==1)
    				res=res*x%Mod;
    			x=x*x%Mod;
    			y>>=1;
    		}
    		
    		return res;
    	}
    	
        public void solve(int testNumber, InputReader sc, PrintWriter out) throws IOException {
        	int n=sc.nextInt();
        	int m=sc.nextInt();
        	long[] f=new long[Max];
        	long[] s=new long[Max];
        	f[1]=2;
        	f[2]=4;
        	
        	for(int i=3;i<Max;i++) {
        		f[i]=(f[i-1]+f[i-2])%Mod;
        	}
        	long[] buf=new long[Max];
        	buf[1]=2;
        	buf[2]=2;
        	s[1]=2;
        	s[2]=4;
        	for(int i=3;i<Max;i++) {
        		buf[i]=(buf[i-1]+buf[i-2])%Mod;
        		s[i]=(s[i-1]+buf[i])%Mod;
        	}
        	long ans=(f[n]+s[m-1])%Mod;
        	out.println(ans);
        }
    }

    static class InputReader{
        StreamTokenizer tokenizer;
        public InputReader(InputStream stream){
            tokenizer=new StreamTokenizer(new BufferedReader(new InputStreamReader(stream)));
            tokenizer.ordinaryChars(33,126);
            tokenizer.wordChars(33,126);
        }
        public String next() throws IOException {
            tokenizer.nextToken();
            return tokenizer.sval;
        }
        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }
        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }
        public boolean hasNext() throws IOException {
            int res=tokenizer.nextToken();
            tokenizer.pushBack();
            return res!=tokenizer.TT_EOF;
        }
        
        public double nextDouble() throws NumberFormatException, IOException {
        	return Double.parseDouble(next());
        }
        
        public BigInteger nextBigInteger() throws IOException {
        	return new BigInteger(next());
        }
    }
}
