#include template class matrix { public: matrix() {} matrix(size_t n, size_t m) : A(n, std::vector(m)) {} matrix(size_t n) : A(n, std::vector(n)) {} size_t height() const { return A.size(); } size_t width() const { return A[0].size(); } inline const std::vector& operator[](size_t k) const { return A[k]; } inline std::vector& operator[](size_t k) { return A[k]; } static matrix I(size_t n) { matrix mat(n); for (size_t i = 0; i < n; ++i) mat[i][i] = 1; return mat; } matrix& operator+=(const matrix& B) { size_t n = height(), m = width(); assert(n == B.height() && m == B.width()); for (size_t i = 0; i < n; ++i) for (size_t j = 0; j < n; ++j) (*this)[i][j] += B[i][j]; return *this; } matrix& operator-=(const matrix& B) { size_t n = height(), m = width(); assert(n == B.height() && m == B.width()); for (size_t i = 0; i < n; ++i) for (size_t j = 0; j < n; ++j) (*this)[i][j] -= B[i][j]; return *this; } matrix& operator*=(const matrix& B) { size_t n = height(), m = B.width(), p = width(); assert(p == B.height()); std::vector C(n, std::vector(m)); for (size_t i = 0; i < n; ++i) for (size_t j = 0; j < m; ++j) for (size_t k = 0; k < p; ++k) C[i][j] += (*this)[i][k] * B[k][j]; A = std::move(C); return *this; } matrix& operator^=(unsigned long long k) { matrix B = matrix::I(height()); while (k > 0) { if (k & 1) B *= *this; *this *= *this; k >>= 1; } A = std::move(B.A); return *this; } matrix operator+(const matrix& B) const { return matrix(*this) += B; } matrix operator-(const matrix& B) const { return matrix(*this) -= B; } matrix operator*(const matrix& B) const { return matrix(*this) *= B; } matrix operator^(unsigned long long k) const { return matrix(*this) ^= k; } friend std::ostream& operator<<(std::ostream& os, matrix& p) { size_t n = p.height(), m = p.width(); for (size_t i = 0; i < n; ++i) { os << '['; for (size_t j = 0; j < m; ++j) { os << p[i][j] << (j + 1 == m ? "]\n" : ","); } } return os; } private: std::vector> A; }; #include using namespace atcoder; using mint = modint1000000007; int main() { size_t n; std::cin >> n; matrix A(2); A[0] = {1, 1}; A[1] = {1, 0}; A ^= n; matrix x(2, 1); x[0] = {1}; x[1] = {0}; auto b = A * x; mint ans = b[0][0] * b[1][0]; std::cout << ans.val() << '\n'; }