import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Scanner;

public class SymbolsStats {
    static final long divisor = 1_000_000_000L + 7;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        PrintWriter printWriter = new PrintWriter(System.out);
        int n, k;
        n = scanner.nextInt();
        k = scanner.nextInt();
        int res = 2;
        long sn = sums(n);
        long sk = sums(k);
        System.out.println((res + 2*(sn + sk)) % divisor);
    }

    static long sums(int n) {
        if (n == 0) return 0;
        long f = 0, s = 1;
        for (int i = 0; i < n; i++) {
            long t = (f + s) % divisor;
            f = s;
            s = t;
        }
        return (s - 1) % divisor;
    }
}
