#include<bits/stdc++.h>#define int long long#define pii pair<int, int>#define pb push_back#define mk make_pair#define F first#define S second#define ALL(x) x.begin(), x.end()usingnamespacestd;usingMatrix=vector<vector<int>>;usingPQ=priority_queue<int,vector<int>,greater<int>>;constintINF=2e18;constintM=1e9+7;intn=3;Matrixoperator*(constMatrix&A,constMatrix&B){MatrixC=Matrix(n,vector<int>(n,0));for(inti=0;i<n;i++){// A rowfor(intj=0;j<(int)B[0].size();j++){// B colfor(intk=0;k<n;k++){C[i][j]+=A[i][k]*B[k][j];C[i][j]%=M;}}}returnC;}Matrixpow(MatrixA,intb){MatrixC=Matrix(n,vector<int>(n,0));for(inti=0;i<n;i++)C[i][i]=1;while(b!=0){if(b&1)C=C*A;A=A*A;b>>=1;}returnC;}signedmain(){intk;cin>>k;MatrixA={{1,1,0},{1,0,0},{0,1,0}};MatrixB={{1},{1},{0}};if(k==0){cout<<0<<'\n';exit(0);}if(k==1){cout<<1<<'\n';exit(0);}MatrixC=pow(A,k-2)*B;cout<<C[0][0]<<"\n";}