import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main
{
    static long mod =1000000007l ,dp[] ;   static int m ;

    public static void main(String[] args){
        new Thread(null, new Runnable() {
            public void run() {
                solve();
            }
        }, "1", 1 << 26).start();
    }
    static void solve () {
        FastReader fr =new FastReader();    PrintWriter op =new PrintWriter(System.out);

        int n =fr.nextInt() ,i ;    m =Math.max(n , fr.nextInt()) ;  dp =new long[m+2] ;
        for (i =0 ; i<m ; ++i)  dp[i] =-9l ;    dp[m] =1l ; dp[m+1] =0l ;

        long ans =(solve (0) + 1l)%mod ;    ans =(2l * ans)%mod ;
        op.println(ans) ;    op.flush();    op.close();
    }
    static long solve (int n) {
        if (dp[n] != -9)    return dp[n] ;

        long ans =(solve(n+1) + solve(n+2))%mod ;
        return dp[n] =ans ;
    }
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

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

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

        String nextLine() {
            String str ="";

            try
            {
                str =br.readLine();
            }
            catch(IOException e)
            {
                e.printStackTrace();
            }

            return str;
        }

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

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