
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.StringTokenizer;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author xylenox
 */
public class c {
    public static void main(String[] args) {
        FS in = new FS(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        int m = in.nextInt();
        long prev = 2;
        long next = 2;
        long tot = 1000000005;
        for(int i = 1; i <= Math.max(n, m); i++) {
            if(i == n || i == m) tot = (tot+next)%1000000007;
            long tmp = next;
            next = (next+prev)%1000000007;
            prev = tmp;
        }
        out.println(tot);
        out.close();
    }
    
    static long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a%b);
    }
    
    static class FS {
        BufferedReader in;
        StringTokenizer token;
        
        public FS(InputStream st) {
            in = new BufferedReader(new InputStreamReader(st));
        }
        
        public String next() {
            if(token == null || !token.hasMoreElements()) {
                try {
                    token = new StringTokenizer(in.readLine());
                } catch(Exception e) {}
                return next();
            }
            return token.nextToken();
        }
        
        public int nextInt() {
            return Integer.parseInt(next());
        }
    }
}
