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

/**
 * Created by Katushka on 20.10.2019.
 */
public class IvanTheFoolProbability {

    final static long MOD = 1000000007;

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int n1 = in.nextInt();
        int m1 = in.nextInt();

        int n = Math.min(n1, m1);
        int m = Math.max(n1, m1);

        if (n == 1 && m == 1) {
            System.out.println(2);
            return;
        }

        long[][] firstRowDP = new long[m][4];
        firstRowDP[1][0] = 1;
        firstRowDP[1][1] = 1;
        firstRowDP[1][2] = 1;
        firstRowDP[1][3] = 1;

        for (int i = 2; i < m; i++) {
            firstRowDP[i][0] = firstRowDP[i - 1][2];
            firstRowDP[i][1] = (firstRowDP[i - 1][0] + firstRowDP[i - 1][2]) % MOD;
            firstRowDP[i][2] = (firstRowDP[i - 1][1] + firstRowDP[i - 1][3]) % MOD;
            firstRowDP[i][3] = firstRowDP[i - 1][1];
        }

        long rows = (firstRowDP[m - 1][0] + firstRowDP[m - 1][1] + firstRowDP[m - 1][2] + firstRowDP[m - 1][3]) % MOD;

        if (n == 1) {
            System.out.println(rows);
            return;
        }


        long[][] firstColDP = new long[n][4];
        firstColDP[1][0] = 1;
        firstColDP[1][1] = 1;
        firstColDP[1][2] = 1;
        firstColDP[1][3] = 1;

        for (int i = 2; i < n; i++) {
            firstColDP[i][0] = firstColDP[i - 1][2];
            firstColDP[i][1] = (firstColDP[i - 1][0] + firstColDP[i - 1][2]) % MOD;
            firstColDP[i][2] = (firstColDP[i - 1][1] + firstColDP[i - 1][3]) % MOD;
            firstColDP[i][3] = firstColDP[i - 1][1];
        }

        long cols = (firstColDP[n - 1][0] + firstColDP[n - 1][1] + firstColDP[n - 1][2] + firstColDP[n - 1][3]) % MOD;

        System.out.println((rows + cols - 2) % MOD);


    }

    private static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

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

        public String nextString() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

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

        public long nextLong() {
            return Long.parseLong(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }
    }
}
