import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
 
public class A3 {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        solve(in, out);
        out.close();
    }
 
    public static void solve(InputReader sc, PrintWriter pw) {
        int i,j;
        int n = sc.nextInt();
        int m = sc.nextInt(),mod=1000000007;
        int max=Math.max(n,m);
        int f[][]=new int[max+1][4];
        if(max==1)
            pw.println(2);
        else{
            f[2][0]=f[2][1]=f[2][2]=f[2][3]=1;
            for(i=3;i<=max;i++){
                f[i][1]=f[i][2]=(f[i-1][1]+f[i-1][0])%mod;
                f[i][0]=f[i][3]=f[i-1][1];
            }
            pw.println((((f[n][0]+f[n][1])%mod+(f[m][0]+f[m][1])%mod)%mod*2%mod-2+mod)%mod);
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;
 
        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }
 
        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
    }
}