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

public class Main {

    void solve() {
        int mod = 1000000007;
        int n = ni();
        int m = ni();
        int k = Math.max(n, m);
        int[][] a = new int[k][2];
        a[0][0] = 1;
        a[0][1] = 0;
        for (int i = 1; i < k; i++) {
            a[i][0] = (a[i-1][0] + a[i-1][1]) % mod;
            a[i][1] = a[i-1][0];
        }
        write(((a[n -1][0] + a[n-1][1]) % mod * 2 % mod + (a[m - 1][0] + a[m-1][1]) % mod * 2 % mod - 2) % mod + "\n");
    }







    public static void main(String[] args) {
        Main m = new Main();
        m.solve();
        try {
            m.out.close();
        } catch (IOException e) {}
    }

    BufferedReader in;
    BufferedWriter out;
    StringTokenizer tokenizer;
    public Main() {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new BufferedWriter(new OutputStreamWriter(System.out));
        } catch(Exception e) {};
    }
    public String n() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(in.readLine());
            } catch (IOException e) {}
        }
        return tokenizer.nextToken();
    }
    public int ni() {
        return Integer.parseInt(n());
    }
    public long nl() {
        return Long.parseLong(n());
    }
    public void write(String s) {
        try {
            out.write(s);
        } catch (IOException e) {}
    }
}