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

public class mainC {
    public static PrintWriter out = new PrintWriter(System.out);
    public static FastScanner enter = new FastScanner(System.in);

    public static void main(String[] args) throws IOException {
        solve();
        out.close();
    }
    static long mod=(long)1e9+7;
    static long dp[][][];
    private static void solve() throws IOException {
        int n=enter.nextInt();
        int m=enter.nextInt();
        if(n==m && m==1){
            out.println(2);
            return;
        }
        dp=new long[Math.max(m+1,n+1)][2][2];
        for (int i = 0; i <2 ; i++) {
            for (int j = 0; j <2 ; j++) {
                dp[1][i][j]=1;
                dp[2][i][j]=1;
            }
        }
        for (int i = 3; i <dp.length ; i++) {
            dp[i][0][0]+=dp[i-1][0][1];
            dp[i][0][1]+=dp[i-1][1][0]+dp[i-1][1][1];
            dp[i][1][0]+=dp[i-1][0][0]+dp[i-1][0][1];
            dp[i][1][1]+=dp[i-1][1][0];
            for (int j = 0; j <2 ; j++) {
                for (int k = 0; k <2 ; k++) {
                    dp[i][j][k]%=mod;
                }
            }
        }
        if(n==1){
            long ansss=dp[m][1][0]+dp[m][1][1]+dp[m][0][0]+dp[m][0][1];
            ansss%=mod;
            out.println(ansss);
            return;
        }
        if(m==1){
            long ansss=dp[n][1][0]+dp[n][1][1]+dp[n][0][0]+dp[n][0][1];
            ansss%=mod;
            out.println(ansss);
            return;
        }
        long ans=0;
        ans+=(dp[m][1][0]+dp[m][1][1]+dp[m][0][0]+dp[m][0][1]-2)%mod;
        ans%=mod;
        ans+=dp[n][1][0]+dp[n][1][1];
        ans%=mod;
        out.println(ans);
    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer stok;

        FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        String next() throws IOException {
            while (stok == null || !stok.hasMoreTokens()) {
                String s = br.readLine();
                if (s == null) {
                    return null;
                }
                stok = new StringTokenizer(s);
            }
            return stok.nextToken();
        }

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

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

        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        char nextChar() throws IOException {
            return (char) (br.read());
        }

        String nextLine() throws IOException {
            return br.readLine();
        }
    }
}
