#include<bits/stdc++.h>
using namespace std;
struct Matrix{
long long c[3][3];
}A,res;
long long n;
const int mod=1e9+7;
Matrix chengfa(Matrix &x,Matrix &y){
Matrix t;
memset(t.c,0,sizeof(t.c));
for(int i=1;i<=2;i++){
for(int j=1;j<=2;j++){
for(int k=1;k<=2;k++){
t.c[i][j]=(t.c[i][j]+(x.c[i][k]*y.c[k][j])%mod)%mod;
}
}
}
return t;
}
void init(){
A.c[1][1]=A.c[1][2]=A.c[2][1]=0;
res.c[1][1]=res.c[1][2]=1;
}
void pow(int n){
while(n){
if(n&1){
res=chengfa(res,A);
}
A=chengfa(A,A);
n>>=1;
}
}
int main(){
cin>>n;
if(n<=2){
cout<<1;
}else{
init();
pow(n-2);
}
cout<<res.c[1][1]%mod;
return 0;
}