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


public class c{

    public static void main(String[] args) {
      MyScanner sc = new MyScanner();
      out = new PrintWriter(new BufferedOutputStream(System.out));

      int MODULO = 1000000007;
      
      int m = sc.nextInt();
      int n = sc.nextInt();
      int x = Math.min(m,n);
      int y = Math.max(m,n);

      int a = 0;
      int b = 2;
      int c = 2;
      int temp = 0;
      int temp2 = 0;
      int counter = 1;

      int m2 = 0;
      int n2 = 0;
      while(n2==0) {
          if(counter == x) {
              m2 = c;
          }
          if(counter == y) {
              n2 = c;
          }
        //   System.out.println(counter+""+a+""+b+""+c);
          temp = b;
          temp2 = c;
          a = b;
          b = c;
          c = (temp + temp2)%MODULO;
          counter += 1;

      }
    out.println((m2+n2-2)%MODULO);




      
      
      

      // Start writing your solution here. -------------------------------------
   
      /*
      int n      = sc.nextInt();        // read input as integer
      long k     = sc.nextLong();       // read input as long
      double d   = sc.nextDouble();     // read input as double
      String str = sc.next();           // read input as String
      String s   = sc.nextLine();       // read whole line as String

      int result = 3*n;
      out.println(result);                    // print via PrintWriter
      */

      // Stop writing your solution here. -------------------------------------
      out.close();
   }

   public static int match(char[] a, char[] b) {
      int count = 0;
      for(int i =0; i<a.length; i++) {
          if(a[i]==b[i]) {
              count++;
          }
      }
      return a.length-count;
   }

   static  class pair{
    int u;
    int v;
    int w;
    int x;
    pair(int u, int v, int w, int x) {
        this.u=u;
        this.v=v;
        this.w=w;
        this.x=x;
    }
    
}

static class sortbyarr implements Comparator<pair> 
{ 
    // Used for sorting in ascending order of 
    // roll number 
    public int compare(pair a, pair b) 
    { 
        return a.u - b.u; 
    } 
}

static class sortbyi implements Comparator<pair> 
{ 
    // Used for sorting in ascending order of 
    // roll number 
    public int compare(pair a, pair b) 
    { 
        return a.x - b.x; 
    } 
}

   //-----------PrintWriter for faster output---------------------------------
   public static PrintWriter out;
      
   //-----------MyScanner class for faster input----------
   public static class MyScanner {
      BufferedReader br;
      StringTokenizer st;
 
      public MyScanner() {
         br = new BufferedReader(new InputStreamReader(System.in));
      }
 
      String next() {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }
 
      int nextInt() {
          return Integer.parseInt(next());
      }
 
      long nextLong() {
          return Long.parseLong(next());
      }
 
      double nextDouble() {
          return Double.parseDouble(next());
      }
 
      String nextLine(){
          String str = "";
	  try {
	     str = br.readLine();
	  } catch (IOException e) {
	     e.printStackTrace();
	  }
	  return str;
      }

   }
   //--------------------------------------------------------
}