import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Comparator;

public class d {
    static BufferedReader s = new BufferedReader(new InputStreamReader(System.in));
    // static Scanner s=new Scanner(System.in);
    public static void main(String[] args) throws IOException {
        StringBuilder sb = new StringBuilder();
        String[] s1=s();
        int n=i(s1[0]);int m=i(s1[1]);
        int mod=1000000007;
        long prev=2;long ans=0;
        long[][] dp=new long[Math.max(m,n)][2];
        dp[0][0]=2;dp[0][1]=0;
        for(int i=1;i<n;i++){
            dp[i][0]=(dp[i-1][1]+dp[i-1][0])%mod;
            dp[i][1]=dp[i-1][0];
        }
        ans=dp[n-1][1]+dp[n-1][0];
        dp[0][0]=2;dp[0][1]=0;
        for(int i=1;i<m;i++) {
            dp[i][0]=(dp[i-1][1]+dp[i-1][0])%mod;
            dp[i][1]=dp[i-1][0];
        }ans=(ans+dp[m-1][1]+dp[m-1][0]-2+mod)%mod;
        System.out.println((ans)%mod);
        //        System.out.println(sb.toString());
//        System.out.println(ans);
    }static void calculatefac(int mod){
        fac[0]=1;
        for (int i = 1 ;i <= MAXN; i++)
            fac[i] = fac[i-1] * i % mod;
    }
    static int MAXN;
    static int[] spf;
  static long powerwithmod(long  x, long y, long p) {
        long  res = 1;
        x = x % p;
        while (y > 0) {
            if ((y & 1) == 1)
                res = (res * x) % p;
            y = y >> 1;
            x = (x * x) % p;
        }
        return res;
    }static long modInverse(long a, long m)
    {
        return (powerwithmod(a, m - 2, m));
    }

    static long[] fac ;
    static long nCrModPFermat(int n, int r, long mod) {
        if (r == 0)
            return 1;
        fac[0] = 1;
        return (fac[n]*
                modInverse(fac[r], mod)
                % mod * modInverse(fac[n-r], mod)
                % mod) % mod;
    }
    static String[] s() throws IOException {

        return s.readLine().trim().split("\\s+");
    }

    static int i(String ss) {
        return Integer.parseInt(ss);
    }
    static long l(String ss) {
        return Long.parseLong(ss);
    }
}

class Student12 {
    int  l;int r;
    public Student12(int l, int r) {
        this.l = l;
        this.r = r;
    }

    public String toString()
    {
        return this.l+" ";
    }
}
class Sortbyroll12 implements Comparator<Student12> {

    public int compare(Student12 a, Student12 b){
       /* if(b.r<a.r) return -1;
        else if(b.r==a.r) return 0;
        return 1;*/
        if(b.r-b.l>a.r-a.l) return 1;
        else if(b.r-b.l==a.r-a.l) {
            return a.l-b.l;
        }else return -1;/*
       if(b.l<a.l) return -1;
       else if(b.l==a.l) {
           return b.r-a.r;
       }
       return 1;*/
        //        return b.r- a.r;
        //        return (int) a.l-(int) b.l;
         /*   if(a.r<b.r) return -1;
            else if(a.r==b.r){
                if(a.r==b.r){
                    return 0;
                }
                if(a.r<b.r) return -1;
                return 1;}
            return 1;  */}
}