n, m = map(int, input().split())
a = [0]
for _ in range(m):
    a.append(int(input()))

count = []
count.append(0)#使用しない
count.append(1)
count.append(2)

ans = 1

for i in range(3,n+1):
    if i in a:
        count.append(0)
        continue
    tmp1 = count[i-1]
    tmp2 = count[i-2]
    if tmp1 in a and tmp2 in a:
        ans = 0
        break
    elif tmp1 in a:
        count.append(tmp2)
    elif tmp2 in a:
        count.append(tmp1)
    else:
        count.append(tmp1 + tmp2)
if ans == 1:
    ans = count[n]
print(ans%1000000007)



        