// practice with kaiboy
import java.io.*;
import java.util.*;

public class CF1248C extends PrintWriter {
	CF1248C() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF1248C o = new CF1248C(); o.main(); o.flush();
	}

	static final int MD = 1000000007;
	void main() {
		int n = sc.nextInt();
		int m = sc.nextInt();
		final int N = Math.max(n, m);
		int[] fib = new int[N + 1];
		fib[0] = fib[1] = 1;
		for (int i = 2; i <= N; i++)
			fib[i] = (fib[i - 2] + fib[i - 1]) % MD;
		long ans = (fib[n] + fib[m] - 1) * 2L % MD;
		if (ans < 0)
			ans += MD;
		println(ans);
	}
}
