import java.util.*;
public class Main {
    public static long MOD = 1_000_000_007;
    public static int n, m, cnt = 0;
    public static void generate(String s) {
        if (s.length() == n * m) {
            char[][] arr = new char[n][m];
            int pos = 0;
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    arr[i][j] = s.charAt(pos++);
                }
            }
            boolean flag = true;
            for (int i = 0; i < n; i++) {
                if (!flag) break;
                for (int j = 0; j < m; j++) {
                    int cnt = 0;
                    if (i > 0 && arr[i - 1][j] == arr[i][j]) cnt++;
                    if (j > 0 && arr[i][j - 1] == arr[i][j]) cnt++;
                    if (i < n - 1 && arr[i + 1][j] == arr[i][j]) cnt++;
                    if (j < m - 1 && arr[i][j + 1] == arr[i][j]) cnt++;
                    if (cnt > 1) {
                        flag = false;
                        break;
                    }
                }
            }
            if (flag) {
                cnt++;
            }
        } else {
            generate(s + 'W');
            generate(s + 'B');
        }
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (true) {
            cnt = 0;
            n = in.nextInt();
            m = in.nextInt();
            int min = Math.min(n, m);
            int max = Math.max(n, m);
            // generate("");
            // System.out.println(cnt);
            long basis = 2;
            long ans = 2;
            long a = 0;
            long b = 4;
            long A = 0;
            long B = 4;
            for (int i = 2; i <= min; i++) {
                long c = a + b;
                long C = A + B;
                C %= MOD;
                basis += b;
                ans += B;
                ans %= MOD;
                a = b;
                b = c;
                A = B;
                B = C;
                A %= MOD;
                B %= MOD;
            }
            a = 0;
            b = 2;
            A = 0;
            B = 2;
            for (int i = 0; i < min - 1; i++) {
                long c = a + b;
                a = b;
                b = c;
                long C = A + B;
                C %= MOD;
                A = B;
                B = C;
                A %= MOD;
                B %= MOD;
            }
            for (int i = 0; i < max - min; i++) {
                long c = a + b;
                long C = A + B;
                C %= MOD;
                ans += B;
                ans %= MOD;
                a = b;
                b = c;
                A = B;
                B = C;
                A %= MOD;
                B %= MOD;
            }
            System.out.println(ans % MOD);
            break;
        }
    }
}