#include<iostream>
#include <math.h>
#include <algorithm>
#include<queue>
#include <bits/stdc++.h>


using namespace std;

#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)

int fib(int n){
    if (N == 0 || n == 1){return 1;}
    else{return fib(n-1) + fib(n-2);}
}

main(){
   int N, M;
   long long c = 0; 
   int pre = 0;
   cin >> N >> M;
   FOR(i,0,M){
       int a = i - pre;
       c += fib(a);   
       pre = i;
   }
   cout << c % 1000000007 <<endl;
}

