import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        final int MOD = (int) (1e9 + 7);

        public void solve(int testNumber, FastScanner in, PrintWriter out) {
//        if (true) {
            if (false) {
                final int N = 24;
                for (int n = 1; n <= N; n++) {
                    for (int m = n; m * n <= N; m++) {
                        int resSlow = slow(n, m);
//                System.out.println(n + " " + m + " " + (n*m) + " " + resSlow);
                        int resFast = fast(n, m);
                        if (resFast != resSlow) {
//                        throw new AssertionError(n + " " + m + " " + resSlow + " " + resFast);
                            System.out.println(n + " " + m + " " + resSlow + " " + resFast);
                        }

                    }
                }
            }

            int n = in.nextInt();
            int m = in.nextInt();
            out.println(fast(n, m));
        }

        private int fast(int n, int m) {
            int[] f = new int[n + m + 10];
            f[0] = 0;
            f[1] = 1;
            for (int i = 2; i < f.length; i++) {
                f[i] = f[i - 1] + f[i - 2];
                if (f[i] >= MOD) {
                    f[i] -= MOD;
                }
            }

            int res = MOD - 2;
            res = (res + f[n - 1]) % MOD;
            res = (res + f[n + 2]) % MOD;
            res = (res + f[m - 1]) % MOD;
            res = (res + f[m + 2]) % MOD;
            return res;
        }

        private int slow(int n, int m) {
            int[][] a = new int[n][m];
            int res = 0;
            for (int mask = 0; mask < 1 << (n * m); mask++) {
                for (int r = 0; r < n; r++) {
                    for (int c = 0; c < m; c++) {
                        a[r][c] = (mask >> (r * m + c)) & 1;
                    }
                }
                boolean ok = true;
                for (int r = 0; r < n; r++) {
                    for (int c = 0; c < m; c++) {
                        int nei = 0;
                        for (int dr = -1; dr <= 1; dr++) {
                            for (int dc = -1; dc <= 1; dc++) {
                                if (dr == 0 ^ dc == 0) {
                                    int nr = r + dr;
                                    int nc = c + dc;
                                    if (nr < 0 || nr >= n || nc < 0 || nc >= m) {
                                        continue;
                                    }
                                    if (a[r][c] == a[nr][nc]) {
                                        ++nei;
                                    }
                                }
                            }
                        }
                        if (nei > 1) {
                            ok = false;
                        }
                    }
                }
                if (ok) {
                    ++res;
                }
            }
            return res;
        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

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

    }
}

