#include using namespace std; #define ll long long #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) using mat = vector>; const ll p = 1e9+7; mat mul(mat A, mat B) { mat ret = {{0,0},{0,0}}; rep(i,2) { rep(j,2) { rep(k,2) { ret[i][j]+=A[i][k]*B[k][j]; ret[i][j]%=p; } } } return ret; } mat matpow(mat &A, ll n) { if(n==0) return {{1,0},{0,1}}; if(n%2==0) { mat AA = matpow(A,n/2); return mul(AA,AA); } return mul(A,matpow(A,n-1)); } int main() { ll n;cin>>n; mat A = {{1,1},{1,0}}; mat C = matpow(A,n-1); mat D = mul(C,A); cout<< (C[0][0]*D[0][0])%p << endl; return 0; }