import java.io.*; import java.util.*; public class Main_yukicoder718 { private static Scanner sc; private static Printer pr; private static void solve() { final int MOD = 1_000_000_007; long n = sc.nextLong(); long fn1 = fibonacciNumber(n + 1, MOD); long fn = fibonacciNumber(n, MOD); long ans = (fn1 * fn1 % MOD - fn * fn % MOD) % MOD + MOD; ans %= MOD; if ((n + 1) % 2 == 1) { ans -= 1; } else { ans -= -1; } pr.println(ans); } private static long fibonacciNumber(long n, int MOD) { // f(0)=0, f(1)=1, f(2)=1,... long[] a = {1, 1, 1, 0}; long[] x = {1, 0}; while(n > 0) { if (n % 2 != 0) { long tmp0 = (x[0] * a[0] + x[1] * a[1]) % MOD; long tmp1 = (x[0] * a[2] + x[1] * a[3]) % MOD; x[0] = tmp0; x[1] = tmp1; } long tmp0 = (a[0] * a[0] + a[1] * a[2]) % MOD; long tmp1 = a[1] * (a[0] + a[3]) % MOD; long tmp2 = a[2] * (a[0] + a[3]) % MOD; long tmp3 = (a[3] * a[3] + a[1] * a[2]) % MOD; a[0] = tmp0; a[1] = tmp1; a[2] = tmp2; a[3] = tmp3; n /= 2; } return x[1]; } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes())); pr = new Printer(System.out); solve(); // pr.close(); pr.flush(); // sc.close(); } static String INPUT = null; private static class Printer extends PrintWriter { Printer(OutputStream out) { super(out); } } }