import java.util.*; public class Main { static long MOD = (long)Math.pow(10, 9) + 7; public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long[][] d = new long[2][2]; d[0][0] = 1; d[0][1] = 1; d[1][0] = 1; long[][] f = func(d, n); long t = f[1][0]; long[][] ans = func(d, t); long anse = ans[1][0]; System.out.println(anse); } public static long[][] func(long[][] a, long x) { if(x == 0) { long[][] b = new long[2][2]; b[0][0] = 1; b[1][1] = 1; return b; } long[][] c = func(a, x / 2); long[][] d = new long[2][2]; d[0][0] = (((c[0][0] * c[0][0]) % MOD) + ((c[0][1] * c[1][0]) % MOD)) % MOD; d[0][1] = (((c[0][0] * c[0][1]) % MOD) + ((c[0][1] * c[1][1]) % MOD)) % MOD; d[1][0] = (((c[1][0] * c[0][0]) % MOD) + ((c[1][1] * c[1][0]) % MOD)) % MOD; d[1][1] = (((c[1][0] * c[0][1]) % MOD) + ((c[1][1] * c[1][1]) % MOD)) % MOD; if(x % 2 == 0) { return d; } else { long[][] e = new long[2][2]; e[0][0] = (((a[0][0] * d[0][0]) % MOD) + ((a[0][1] * d[1][0]) % MOD)) % MOD; e[0][1] = (((a[0][0] * d[0][1]) % MOD) + ((a[0][1] * d[1][1]) % MOD)) % MOD; e[1][0] = (((a[1][0] * d[0][0]) % MOD) + ((a[1][1] * d[1][0]) % MOD)) % MOD; e[1][1] = (((a[1][0] * d[0][1]) % MOD) + ((a[1][1] * d[1][1]) % MOD)) % MOD; return e; } } }