import java.util.*;
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 Main {
	public static int maxn = (int) (1e6 + 5);
	public static double PI = Math.acos(-1.0);
	public static double eps = 1e-6;	
	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 static int[] fib = new int[100005];
	public static int[][] sum = new int[100005][3];
	public static int mod = (int)(1e9 + 7);
	public static void main(String[] args) {
		InputStream inputStream = System.in;
        InputReader in = new InputReader(inputStream);
		int n = in.nextInt();
		int m = in.nextInt();
		if(n < m) {
			int t = n;
			n = m; m = t;
		}
		
//		System.out.println(n + " " + m);
		fib[0] = 1; fib[1] = 1;
		for(int i = 2; i <= n; ++i) {
			fib[i] = (fib[i - 1] + fib[i - 2])%mod;
//			System.out.println("fib: " + i + " " + fib[i]);
		}
		if(m == 1) {
			System.out.println((fib[n]*2)%mod);
			return ;
		}
		int ans = (fib[m] + fib[n] - 1)%mod;
		ans = (((ans + mod)%mod)*2)%mod;
		System.out.println(ans);
	}
}
