n,m = map(int,input().split())
mod = 10**9 + 7
a = [-1] * (n+1)
a[0]=0
for i in range(1,m+1):
    b = int(input())
    a[b] = 0

if a[1] == 0:
    a[2] = 1
else:
    a[1] = 1
    if a[2] != 0:
        a[2] = 2
        
for i in range(3,n+1):
    if a[i] != 0:
        a[i] = a[i-1] + a[i-2]
#print(a)
print(a[n] % mod)