import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt(), m = s.nextInt();
        int max = Math.max(n, m);
        int[] res = new int[max+1];
        res[1] = 1;
        if (max>1) res[2] = 2;
        for (int i=3; i<=max; i++) res[i] = (res[i-1] + res[i-2])%1000000007;
        long a = res[n], b = res[m];
        long ans = a*2+b*2-2;
        System.out.println(ans%1000000007);
    }
}