import java.util.Scanner; public class Main { static long d = 1000000000 + 7; public static void main(String[] args) { Scanner scan = new Scanner(System.in); long N = scan.nextLong(); scan.close(); long m; if(N % 2 == 1) { m = N / 2 + 1; }else { m = N / 2; } long [][][]A = new long[40][2][2]; A[0][0][0] = 1; A[0][0][1] = 1; A[0][1][0] = 1; A[0][1][1] = 0; for(int i = 1; i < 40; i++) { long a00 = A[i -1][0][0] % d; long a01 = A[i -1][0][1] % d; long a10 = A[i -1][1][0] % d; long a11 = A[i -1][1][1] % d; A[i][0][0] = ((a00 * a00) % d + (a01 * a10) % d) % d; A[i][0][1] = ((a00 * a01) % d + (a01 * a11) % d) % d; A[i][1][0] = ((a10 * a00) % d + (a11 * a01) % d) % d; A[i][1][1] = ((a10 * a01) % d + (a11 * a11) % d) % d; } String num = Long.toBinaryString(N); long [][]Am = new long[2][2]; Am[0][0] = 1; Am[1][1] = 1; //System.out.println(num.length()); for(int i = 0; i < num.length(); i++) { char c = num.charAt(num.length() - i - 1); //char c = num.charAt(i); if(c == '1') { long [][]At = new long[2][2]; At = square(Am, A[i]); for(int j = 0; j < 2; j++) { for(int k = 0; k < 2; k++) { Am[j][k] = At[j][k]; } } for(int j = 0; j < 2; j++) { for(int k = 0; k < 2; k++) { Am[j][k] = Am[j][k] % d; } } } } long a = Am[0][0] % d; long b = Am[0][1] % d; System.out.println(a * b % d); } static long[][] square(long[][]A1, long[][]A2) { long[][]A = new long[2][2]; for(int i = 0; i < 2; i++) { for(int j = 0; j < 2; j++) { long t = 0; for(int k = 0; k < 2; k++) { t += (A1[i][k] * A2[k][j]) % d; } t = t % d; A[i][j] = t; } } return A; } static void disp(long [][]A) { for(int i = 0; i < 2; i++) { System.out.println(A[i][0] + " " + A[i][1]); } System.out.println(); } }