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

public class A {

    int solve(int n, int m) {
        boolean[][] b = new boolean[n][m];
        int ans = 0;
        for (int mask = 0; mask < 1 << (n * m); mask++) {
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    b[i][j] = (mask & (1 << (i * m + j))) > 0;
                }
            }
            boolean ok = true;
            fr:
            for (int x = 0; x < n; x++) {
                for (int y = 0; y < m; y++) {
                    int cnte = 0;
                    for (int d = 0; d < DX.length; d++) {
                        int nx = x + DX[d];
                        int ny = y + DY[d];
                        if (nx >= 0 && nx < n && ny >= 0 && ny < m && b[x][y] == b[nx][ny]) {
                            cnte++;
                        }
                    }
                    if (cnte > 1) {
                        ok = false;
                        break fr;
                    }
                }
            }
            if (ok) {
                ans++;
            }
        }
        return ans;
    }

    int solve2(int n, int m) {
        if (n < m) {
            int tmp = n;
            n = m;
            m = tmp;
        }
        int[] a = new int[Math.max(n, m) + 2];
        a[0] = 2;
        a[1] = 2;
        for (int i = 2; i < a.length; i++) {
            a[i] = (a[i - 1] + a[i - 2]) % MOD;
        }
        int res = a[n];
        for (int i = 0; i < m - 1; i++ ) {
            res = (res + a[i]) % MOD;
        }
        return res;
    }

    int[] DX = {-1, 0, 1, 0};
    int[] DY = {0, -1, 0, 1};
    int MOD = 1_000_000_007;

    void solve() throws IOException {
//        vis();
        int n = nextInt();
        int m = nextInt();
        out.println(solve2(n, m));
    }

    private void vis() {
        for (int n = 1; n < 10; n++) {
            for (int m = 1; m < 10; m++) {
                if (n * m > 25) {
                    continue;
                }
                System.err.print(solve(n, m));
                if (solve(n, m) != solve2(n, m)) {
//                    throw  new AssertionError(n + " " + m + " " +solve(n, m) + " " + solve2(n, m));
                    System.err.print("("+solve2(n, m)+")");
                }
                System.err.print("\t");
            }
            System.err.println();
        }
    }

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

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

    StringTokenizer st;
    BufferedReader br;
    PrintWriter out;

    void run() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        long time = System.currentTimeMillis();
        solve();
        System.err.println("time = " + (System.currentTimeMillis() - time));
        out.close();
    }

    public static void main(String[] args) throws IOException {
        new A().run();
    }

}
