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

public class Main {
	public static void main(String args[]) {new Main().run();}

	FastReader in = new FastReader();
	PrintWriter out = new PrintWriter(System.out);
	void run(){
		work();
		out.flush();
	}
	long mod=1000000007;
	long gcd(long a,long b) {
		return b==0?a:gcd(b,a%b);
	}
	void work() {
		int n=in.nextInt();
		int m=in.nextInt();
		long r1=2,r0=2;
		for(int i=1;i<n;i++) {
			long t=r1+r0;
			r0=r1;
			r1=t%mod;
		}
		long c1=2,c0=2;
		for(int i=1;i<m;i++) {
			long t=c1+c0;
			c0=c1;
			c1=t%mod;
		}
		long ret=(c1+r1-2)%mod;
		if(ret<0) {
			ret+=mod;
		}
		out.println(ret);
	}
	
	private int find(int v,Node node,int l,int r) {
		if(l==r)return l;
		int m=(l+r)/2;
		if(node.lNode.cnt>=v) {
			return find(v,node.lNode,l,m);
		}else {
			return find(v-node.lNode.cnt,node.rNode,m+1,r);
		}
	}
	private void insert(int v, Node node, int l, int r) {
		node.cnt++;
		if(l==r)return;
		if(node.lNode==null)node.lNode=new Node(0);
		if(node.rNode==null)node.rNode=new Node(0);
		int m=(l+r)/2;
		if(v<=m) {
			insert(v,node.lNode,l,m);
		}else {
			insert(v,node.rNode,m+1,r);
		}
	}

	class Node{
		Node lNode;
		Node rNode;
		int cnt;
		Node(int c){
			cnt=c;
		}
	}
}



class FastReader
{
	BufferedReader br;
	StringTokenizer st;

	public FastReader()
	{
		br=new BufferedReader(new InputStreamReader(System.in));
	}

	public String next() 
	{
		if(st==null || !st.hasMoreElements())
		{
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

	public int nextInt() 
	{
		return Integer.parseInt(next());
	}

	public long nextLong()
	{
		return Long.parseLong(next());
	}
}