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

import java.util.*;

public class Main {
    static int mod=1_000_000_007;
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);

        int n = in.nextInt();
        int m = in.nextInt();
        long right_a = 2L;
        long right_b = 0L;
        long b_a = 0L;
        long b_b = 0L;
        for (int i=1;i<n;i++) {
            b_a = right_a;
            b_b = right_b;
            right_a = (b_a + b_b)%mod;
            right_b = b_a%mod;
        }
        // out.println("right_a: " + right_a + " right_b: " + right_b);
        out.println(((right_a+right_b-2)%mod + 2*fib(m))%mod);
        // out.println(fib(n));
        out.close();
    }
    static long fib(int n) {
        long fn=0;
        long f0=0;
        long f1=1;
        for (int i=0;i<n;i++) {
            fn = (f0 + f1)%mod;
            f0 = f1;
            f1 = fn;
        }
        return fn;
    }
    static long pow(long a,int n) {
        long res=1;
        while (n>0) {
            if ((n-n/2*2)==1) {
                res=res*a%mod;
            }
            a=a*a%mod;
            n>>=1;
        }
        return res;
    }
    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());
        }

    }
}
