import sys,random,bisect from collections import deque,defaultdict from heapq import heapify,heappop,heappush from itertools import permutations from math import gcd input = lambda :sys.stdin.readline().rstrip() mi = lambda :map(int,input().split()) li = lambda :list(mi()) def mat_mul(X,Y): n,m = len(X),len(Y[0]) res = [[0 for j in range(m)] for i in range(n)] for i in range(n): for j in range(m): for k in range(len(Y)): res[i][j] += X[i][k] * Y[k][j] res[i][j] %= mod return res mod = 10**9 + 7 def fibonacci(n): if n <= 1: return 1 E = [[1],[1]] A = [[1,1],[1,0]] k = n-1 while k: if k&1: E = mat_mul(A,E) A = mat_mul(A,A) k >>= 1 return E[0][0] f = [1,2,5,10] def fibonacci_sq(n): if n <= 3: return f[n] E = [[f[i]] for i in range(4)[::-1]] A = [[2,1,-2,-1],[1,0,0,0],[0,1,0,0],[0,0,1,0]] k = n-3 while k: if k&1: E = mat_mul(A,E) A = mat_mul(A,A) k >>= 1 return E[0][0] N = int(input()) if N==1: exit(print(1)) if N&1==0: exit(print(fibonacci(N//2))) else: res = fibonacci_sq((N-1)//2) + fibonacci_sq((N-3)//2) print(res % mod)