#include <iostream>
using namespace std;
#define NUM 1000000007
#define JianGe 100000000
int main(){
int n;
cin>>n;
long long array1[10] = {945351196,80688602,800447448,947746097,220121405,539612979,850278613,975243705,442753488,999999994};
long long array2[10] = {853811327,452664165,768435528,340207074,84908948,544273633,243519942,505386617,105110174,8};
int index = n/JianGe;
int new_n = n-index*JianGe;
long long *temp = new long long[new_n+1];
temp[0]=array1[index-1];temp[1]=array2[index-1];
for(int i=2;i<=new_n;i++)
temp[i] = ((temp[i-1]+temp[i-2])%NUM)%NUM;
cout<<temp[new_n]<<endl;
return 0;
}