#include <cmath>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <iostream>
#include <ostream>
#include <vector>

void operator delete(void *p)noexcept{}
void operator delete(void *p,size_t size)noexcept{}
void operator delete[](void *p)noexcept{}
void operator delete[](void *p,size_t size)noexcept{}

using ll = int64_t;

const ll p = 1e9+7;
ll n = std::pow(2,63);

using v2d = std::vector<std::vector<ll>>;

void setid(v2d&a,bool issimple=true){
    if(issimple){
        for(ll i=0;i<a.size();i++){
            a[i][i]=1;
        }
    }else{
        for(ll i=0;i<a.size();i++){
            for(ll j=0;j<a[i].size();j++){
                a[i][j]=0;
            }
            a[i][i]=1;
        }
    }
}

v2d operator*(v2d const&a,v2d const&b){
    v2d res(a.size(),std::vector<ll>(b[0].size()));
    for(ll i=0;i<a.size();i++){
        for(ll j=0;j<b[0].size();j++){
            for(ll k=0;k<a[0].size();k++){
                res[i][j]=(res[i][j]+a[i][k]*b[k][j]%p)%p;     
            }
        }
    }
    return res;
}

v2d fp(v2d b,ll e){
    v2d res(b.size(),std::vector<ll>(b[0].size()));
    setid(res);
    while(e){
        if(e&1)res=res*b;
        b=b*b;
        e/=2;
    }
    return res;
}

std::ostream&operator<<(std::ostream&os,v2d const& v){
    os<<"{ ";
    for(ll i=0;i<v.size();i++){
        os<<"{ ";    
        for(ll j=0;j<v[i].size();j++){
            std::cout<<v[i][j]<<" ,";
        }
        std::cout<<" }, ";
    }
    os<<"}";
    return os;
}

#define NV(v)std::cout<<#v<<" :"<<(v)<<'\n';

int main(){
    std::ostream::sync_with_stdio(false),std::cin.tie(nullptr),std::cout.tie(nullptr);
    std::cin>>n;
    if(n<=2){
        std::cout<<"1\n";
        return 0;
    }
    n-=2;
    v2d base(2,std::vector<ll>(2));
    base[0][1]=base[1][0]=base[1][1] = 1;
    base = fp(base,n);
    std::cout<<(base[0][1]+base[1][1])%p<<'\n'<<std::flush;
    quick_exit(0);
}