import java.util.*;
import java.time.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        final long mod = 1000000007L;
        int min = Math.min(n,m);
        int max = Math.max(n,m);
        long sum1 = 1;
        long sum2 = 1;
        long tmp;
        for (int i=0; i<min-1; i++) {
            tmp = sum2;
            sum2 += sum1;
            sum1 = tmp;
            sum1 %= mod;
            sum2 %= mod;
        }
        long s1 = sum2;
        for (int i=min-1; i<max-1; i++) {
            tmp = sum2;
            sum2 += sum1;
            sum1 = tmp;
            sum1 %= mod;
            sum2 %= mod;
        }
        long s2 = sum2;
        long result = 2*(s1+s2-1);
        result%=mod;
        System.out.println(result);
    }

}