#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
using namespace std;
const int Mod=1000000007;
long long n;
struct matrix{
long long z[3][3];
matrix()
{
memset(z,0,sizeof(z));
}
};
matrix operator*(const matrix &a,const matrix &b)
{
matrix c;
matrix();
for(int i=1;i<=2;i++)
for(int j=1;j<=2;j++)
for(int k=1;k<=2;k++)
c.z[i][j]=c.z[i][j]%Mod+a.z[i][k]*b.z[k][j]%Mod;
return c;
}
matrix a;
matrix b;
void init()
{
a.z[1][1]=1,a.z[1][2]=1;
b.z[1][1]=1,b.z[1][2]=1,b.z[2][1]=1,b.z[2][2]=0;
}
void ksm(int y)
{
while(y)
{
if(y&1) a=a*b;
b=b*b;
y>>=1;
}
return ;
}
int main()
{
cin>>n;
if(n<=2)
{
cout<<1<<endl;
return 0;
}
init();
ksm(n-1);
cout<<a.z[1][2]%Mod<<endl;
return 0;
}