16 lines
278 B
Python
16 lines
278 B
Python
|
# 1 1 2 3 5
|
||
|
list=[]
|
||
|
for i in range(100000):
|
||
|
list.append(0)
|
||
|
def feibo(n):
|
||
|
if n==1 or n==2:
|
||
|
return 1
|
||
|
if list[n]!=0:
|
||
|
return list[n]
|
||
|
else:
|
||
|
a=feibo(n-1)+feibo(n-2)
|
||
|
list[n]=a
|
||
|
return a
|
||
|
n=int(input())
|
||
|
b=feibo(n)
|
||
|
print(b%(10**9+7))
|