#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) const long long MOD = 1e9 + 7; typedef vector vec; typedef vector matrix; matrix eye(int n) { matrix mat(n, vec(n)); for (int i = 0; i < n; i++) { mat[i][i] = 1; } return mat; } matrix zeros(int r, int c) { return matrix(r, vec(c)); } matrix zeros(int n) { return zeros(n, n); } matrix add(const matrix &a, const matrix &b) { matrix c = zeros(a.size(), a[0].size()); for (int i = 0; i < c.size(); i++) { for (int j = 0; j < c[0].size(); j++) { c[i][j] = a[i][j] + b[i][j]; } } return c; } matrix mul(const matrix &a, const matrix &b) { matrix c = zeros(a.size(), b[0].size()); for (int i = 0; i < a.size(); i++) { for (int k = 0; k < b.size(); k++) { for (int j = 0; j < b[0].size(); j++) { c[i][j] += a[i][k] * b[k][j]; } } } return c; } matrix modmul(const matrix &a, const matrix &b, long long mod) { matrix c = zeros(a.size(), b[0].size()); for (int i = 0; i < a.size(); i++) { for (int k = 0; k < b.size(); k++) { for (int j = 0; j < b[0].size(); j++) { c[i][j] = (c[i][j] + a[i][k] * b[k][j]) % mod; } } } return c; } matrix pow(const matrix &a, long long p) { matrix ret = eye(a.size()); matrix x = a; while (p) { if (p & 1) ret = mul(ret, x); x = mul(x, x); p >>= 1; } return ret; } matrix modpow(const matrix &a, long long p, long long mod) { matrix ret = eye(a.size()); matrix x = a; while (p) { if (p & 1) ret = modmul(ret, x, mod); x = modmul(x, x, mod); p >>= 1; } return ret; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); long long n; cin >> n; matrix a = zeros(2); a[0][1] = a[1][0] = a[1][1] = 1; a = modpow(a, n, MOD); cout << a[0][1] * a[1][1] % MOD << endl; return 0; }