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

public class p1248C {

	public void realMain() throws Exception {

		BufferedReader fin = new BufferedReader(new InputStreamReader(System.in), 1000000);

		String in = fin.readLine();

		String[] ar = in.split(" ");

		int n = Integer.parseInt(ar[0]);
		int m = Integer.parseInt(ar[1]);

		BigInteger two = new BigInteger("2");

		BigInteger l = new BigInteger("2");
		BigInteger r = new BigInteger("4");

		int cnt = 2;

		BigInteger nval = BigInteger.ZERO;
		BigInteger mval = BigInteger.ZERO;

		if(n == 1) {
			nval = l;
		} else if(n == 2) {
			nval = r;
		}

		if(m == 1) {
			mval = l;
		} else if(m == 2) {
			mval = r;
		}

		
		if(!nval.equals(BigInteger.ZERO) && !mval.equals(BigInteger.ZERO)) {
			System.out.println(nval.add(mval).subtract(two));
			return;
		}

		while(cnt <= Math.max(n, m)) {
			BigInteger tmp = l.add(r);
			l = r;
			r = tmp;
			cnt++;

			if(cnt == n) {
				nval = r;
			}
			if(cnt == m) {
				mval = r;
			}
		}

		System.out.println(nval.add(mval).subtract(two).mod(new BigInteger("1000000007")));
		return;

		


	}


	public static void main(String[] args) throws Exception {
		p1248C a = new p1248C();
		a.realMain();
	}
}