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

public class Main {
    static PrintWriter pw;
    static final long mod = (long) (1e9 + 7);

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        int m = sc.nextInt();
        long dp[][] = new long[n][2];
        dp[0][0] = 1;
        dp[0][1] = 0;
        for (int i = 1; i < n; i++) {
            dp[i][0] = (dp[i - 1][0] + dp[i - 1][1])%mod;
            dp[i][1] = dp[i - 1][0];
        }
        long ans = (dp[n - 1][0] + dp[n - 1][1] - 1 + mod)%mod;
        ans = ans * 2;
        ans = ans%mod;
        dp = new long[m][2];
        dp[0][0] = 1;
        dp[0][1] = 0;
        for (int i = 1; i < m; i++) {
            dp[i][0] = (dp[i - 1][0] + dp[i - 1][1])%mod;
            dp[i][1] = dp[i - 1][0];
        }
        long ans2 = (dp[m - 1][0] + dp[m - 1][1] - 1 +mod)%mod;
        ans2 = ans2 * 2;
        ans2 = ans2%mod;
        pw.println((ans + ans2 + 2)%mod);
        pw.close();
    }
}