main = do n <- readLn :: IO Integer let p = 10^9+7 print $ ((fibonacci n p) * (fibonacci (n+1) p)) `mod` p {-- Fibonacci数の一般項 --} fibonacci 0 _ = 0 fibonacci 1 _ = 1 fibonacci n p = let [x,_,_,_] = matpow [1,1,1,0] (n-1) in x `mod` p where matprod [a,b,c,d] [w,x,y,z] = map (`mod` p) [a*w+b*y,a*x+b*z,c*w+d*y,c*x+d*z] matpow a 0 = [1,0,0,1] matpow a 1 = a matpow a p = let t = matpow a (div p 2) in (if even p then id else (`matprod` a)) (t `matprod` t)