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

public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] s = br.readLine().split(" ");
		int n = Integer.parseInt(s[0]);
		int m = Integer.parseInt(s[1]);
		int max = Math.max(n, m);

		if (max == 1) {
			System.out.println("2");
			System.exit(0);
		}

		long[] ar = new long[max + 1];
		ar[1] = 0;
		ar[2] = 2;

		for (int i = 3; i < max + 1; i++) {
			ar[i] = (ar[i - 1] + ar[i - 2]) % 1000000007;
		}
		long fn = (2 * ar[n] + ar[n - 1]) % 1000000007;
		long fm = (2 * ar[m] + ar[m - 1]) % 1000000007;
		long answer;
		if (n == 1 || m == 1) {
			answer = (fn + fm) % 1000000007;
		} else {
			answer = (fn + fm - 2) % 1000000007;
		}
		//System.out.println(Arrays.toString(ar));
		//System.out.println(fn + " " + fm);
		System.out.println(answer);

	}
}