N,M=map(int,input().split())
a=[int(input())-1 for i in range(M)]

mod=10**9+7

if N==1:
    print(1)
    exit()

f=[0]*(N+1)

if 0 in a:
    f[0]=0
else:
    f[0]=1

if 1 in a:
    f[1]=0
else:
    f[1]=f[0]+1

for i in range(2,N):
    if i-2 in a:
        f[i]=f[i-1]
    elif i-1 in a:
        f[i]=f[i-2]
    else:
        f[i]=f[i-2]+f[i-1]

    f[i]=f[i]%mod

print(f[N-1])