#!/usr/bin/python2 # -*- coding: utf-8 -*- # † def matmul(A, B, mod): return [ (A[0]*B[0] + A[1]*B[2]) % mod, (A[0]*B[1] + A[1]*B[3]) % mod, (A[2]*B[0] + A[3]*B[2]) % mod, (A[2]*B[1] + A[3]*B[3]) % mod ] def matpow(A, n, mod): res = [1, 0, 0, 1] while n > 0: if n & 1: res = matmul(res, A, mod) A = matmul(A, A, mod) n >>= 1 return res def fib(n, mod): A = [1, 1, 1, 0] R = matpow(A, n-1, mod) return R[0] n = int(raw_input()) if n == 0: print 0 exit(0) m = fib(n, 2000000016) x = fib(m, 10**9 + 7) print x