import java.io.*;
import java.util.*;

public class Main {
    static long mod = (long)1e9 + 7;
    public static void main(String[] args) throws IOException {
        FastScanner in = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        // FastScanner in = new FastScanner("search.in");
        //PrintWriter out = new PrintWriter("search.out");
        int n = in.nextInt();
        int m = in.nextInt();
        long dp1[] = new long[Math.max(n,m)];
        long dp2[] = new long[Math.max(n,m)];
        long dp3[] = new long[Math.max(n,m)];
        long dp4[] = new long[Math.max(n,m)];
        dp2[0] = 1;
        for (int i = 1; i < m; i++) {
            dp1[i] = dp2[i-1];
            dp2[i] = dp1[i-1] + dp2[i-1];
            dp2[i]%=mod;
            dp1[i]%=mod;
        }
        dp4[0] = 2;
        for (int i = 1; i < n; i++) {
            dp3[i] = dp4[i-1];
            dp4[i] = dp4[i-1] + dp3[i-1];
            dp3[i]%=mod;
            dp4[i]%=mod;
        }
        out.println((dp3[n-1]%mod + dp4[n-1]%mod + (2 * (dp1[m-1] + dp2[m-1] - 1)%mod)%mod)%mod);
        out.close();
    }
}


class FastScanner {
    BufferedReader br;
    StringTokenizer st = new StringTokenizer("");

    public FastScanner(InputStream s) {
        br = new BufferedReader(new InputStreamReader(s));
    }

    public FastScanner(String s) throws FileNotFoundException {
        br = new BufferedReader(new FileReader(new File(s)));
    }

    public String next() throws IOException {
        if (!st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

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

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

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

class point {
    int x, y;

    public point(int x, int y) {
        this.x = x;
        this.y = y;
    }
}