inputs = input().split(' ')
n = int(inputs[0])+1
a = [-1]
while True:
    try:
        a.append(int(input()))
    except:
        break

a_next = a[1:] + [n]
margins = []
for i, j in zip(a, a_next):
    margins.append(j-i-1)

mod = 1000000007
N_max = pow(10,5)
fibo_list = [0 for i in range(N_max+1)]
fibo_list[0] = 0
fibo_list[1] = 1
fibo_list[2] = 1
for i in range(3,N_max+1):
    fibo_list[i] = (fibo_list[i-1] + fibo_list[i-2])%mod

result = 1
for i in margins:
    result = (result*fibo_list[i])%mod

print(result)
