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

public class Main {

    int mod = (int) 1e9 + 7;
    public void solve(InputReader in, PrintWriter out) {
        int m = in.nextInt();
        int n = in.nextInt();
        long res = 0;
        long a = 0;
        long b = 1;
        int min = Math.min(m,n);
        for (int i = 1; i <= Math.max(m,n); i++) {
            long c = a+b;
            c = mod(c);
            a = b;
            b = c;
            if (min == i) res = b;
        }
        res += b;
        res--;
        res *= 2;
        res = mod(res);
        out.println(res);
    }

    public long mod(long m) {
        if (m >= mod) m %= mod;
        return m;
    }

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Main obj = new Main();
        obj.solve(in, out);
        out.close();
    }

    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 {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public float nextFloat() {
            return Float.parseFloat(next());
        }

    }
}
