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

public class IvantheFoolandtheProbabilityTheory {

	// https://codeforces.com/contest/1239/problem/A
	
	public static void main(String[] args) throws IOException, FileNotFoundException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		//BufferedReader in = new BufferedReader(new FileReader("IvantheFoolandtheProbabilityTheory"));

		StringTokenizer st = new StringTokenizer(in.readLine());
		int n = Integer.parseInt(st.nextToken());
		int m = Integer.parseInt(st.nextToken());
		if (m > n) {
			int temp = m;
			m = n;
			n = temp;
		}
		long[] x = new long[n+2];
		long mod = (long)1e9 +7;
		x[1] = 2;
		if (n>=2) x[2] = 4;
		if (n>=3) x[3] = 6;
		for (int i=4; i<n+2; i++) {
			x[i] = 2*x[i-2]%mod + x[i-3]%mod;
			x[i] %= mod;
		}
		
		long ans = (x[n] - 2) + 2*m%mod;
		ans %= mod;
		System.out.println(ans);
		
	}
}
