import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

import static java.lang.Math.*;

public class Main {
    void run() throws IOException {
        int n = nextInt();
        int m = nextInt();
        long[][] dp = new long[n + 1][2];
        dp[0][0] = 1;
        dp[0][1] = 1;
        dp[1][0] = 1;
        dp[1][1] = 1;
        for (int i = 2; i < dp.length; i++) {
            dp[i][0] += dp[i - 1][1] + dp[i - 2][1];
            dp[i][1] += dp[i - 1][0] + dp[i - 2][0];
            dp[i][0] %= mod;
            dp[i][1] %= mod;
        }
        long[][] overdp = new long[m + 1][2];
        overdp[0][0] = 1;
        overdp[0][1] = 1;
        overdp[1][0] = 1;
        overdp[1][1] = 1;
        for (int i = 2; i < overdp.length; i++) {
            overdp[i][0] += overdp[i - 1][1] + overdp[i - 2][1];
            overdp[i][1] += overdp[i - 1][0] + overdp[i - 2][0];
            overdp[i][0] %= mod;
            overdp[i][1] %= mod;
        }
        pw.print((dp[n][0] + dp[n][1] + overdp[m][0] + overdp[m][1] - 2) % mod);
        pw.close();
    }

    class Point {
        int x, y;

        public Point(long a, int b, int c) {
            x = b;
            y = c;
        }
    }

    class PointComp implements Comparator<Point> {

        @Override
        public int compare(Point o1, Point o2) {
            if (o1.x == o2.x) return Integer.compare(o1.y, o2.y);
            return Integer.compare(o1.x, o2.x);
        }
    }

    long mod = (long) 1e9 + 7;
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    //BufferedReader br = new BufferedReader(new FileReader("qual.in"));

    StringTokenizer st = new StringTokenizer("");
    PrintWriter pw = new PrintWriter(System.out);
    //PrintWriter pw = new PrintWriter("qual.out");

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

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

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

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

    public Main() throws FileNotFoundException {
    }

    public static void main(String[] args) throws IOException {
        new Main().run();
    }
}