N = int(input()) mod = 10**9 + 7 cycle = 2000000016 def fibonacci(N,mod): f1,f=1,1 r1,r=1,0 while N: if N&1: r1,r=(f1*r1+f*r)%mod,(f1*r+f*(r1-r))%mod f1,f=(f1**2+f**2)%mod,f*(2*f1-f)%mod N>>=1 return r fibN = fibonacci(N, cycle) print(fibonacci(fibN, mod))