#include #include #include using namespace std; using i64 = long long; using mat = i64[2][2]; const int mod = 1000000007; inline void matmul(mat A, mat B, mat res) { mat R = {{0, 0}, {0, 0}}; R[0][0] = (A[0][0]*B[0][0] + A[0][1]*B[1][0]) % mod; R[0][1] = (A[0][0]*B[0][1] + A[0][1]*B[1][1]) % mod; R[1][0] = (A[1][0]*B[0][0] + A[1][1]*B[1][0]) % mod; R[1][1] = (A[1][0]*B[0][1] + A[1][1]*B[1][1]) % mod; memcpy(res, R, sizeof(R)); } inline void matpow(mat A, i64 n, mat res) { mat R = {{1, 0}, {0, 1}}; for(; n>0; n>>=1) { if(n & 1) { matmul(R, A, R); } matmul(A, A, A); } memcpy(res, R, sizeof(R)); } inline i64 bigint2modint(string bignum, i64 mod) { i64 res = 0; for(char c : bignum) { (res *= 10) += (c - '0'); res %= mod; } return res ? res : mod-1; } inline i64 mod_pow(i64 a, i64 n, i64 mod) { i64 res = 1LL; for(i64 p=a, x=n; x>0; x>>=1) { if(x & 1) { (res *= p) %= mod; } (p *= p) %= mod; } return res; } int main(void) { int n; scanf("%d", &n); i64 res = 1; for(int i=0; i