#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const long long MAX = 5100000; const long long INF = 1LL << 60; const long long MOD = 1000000007LL; //const long long mod = 998244353LL; using namespace std; typedef unsigned long long ull; typedef long long ll; struct Matrix { vector > val; Matrix(int n, int m, long long x = 0) : val(n, vector(m, x)) {} void init(int n, int m, long long x = 0) { val.assign(n, vector(m, x)); } size_t size() const { return val.size(); } inline vector& operator [] (int i) { return val[i]; } }; Matrix operator * (Matrix A, Matrix B) { Matrix R(A.size(), B[0].size()); for (int i = 0; i < A.size(); ++i) for (int j = 0; j < B[0].size(); ++j) for (int k = 0; k < B.size(); ++k) R[i][j] = (R[i][j] + A[i][k] * B[k][j] % MOD) % MOD; return R; } Matrix modpow(Matrix A, long long n) { Matrix R(A.size(), A.size()); for (int i = 0; i < A.size(); ++i) R[i][i] = 1; while (n > 0) { if (n & 1) R = R * A; A = A * A; n >>= 1; } return R; } int main() { /* cin.tie(nullptr); ios::sync_with_stdio(false); */ ll n; cin >> n; Matrix mat(2, 2); mat[0][0] = 1; mat[0][1] = 1; mat[1][0] = 1; mat[1][1] = 0; Matrix ini(2, 1); ini[0][0] = 1; ini[1][0] = 0; Matrix res = modpow(mat, n) * ini; cout << res[0][0] * res[1][0] % MOD << endl; return 0; }