import sys

N,M=map(int,input().split())
a=[int(input()) for i in range(M)]
c=[0]*(N+1)
c[0]=1
MOD=7+10**9
if M==0:
    c[1]=1
    for i in range(1,N):
        c[i+1]=c[i]+c[i-1]
    print(c[N])
elif N==1:
    print(1)
else:
    j=0
    for i in range(1,N):
        if i==a[j]:
            if j+1<M:
                if i+1==a[j+1]:
                    print(0)
                    sys.exit(0)
                else:
                    j+=1
        elif i==2:
            c[i]=c[i-1]
        else:
            c[i]=(c[i-1]+c[i-2])%MOD
    print(c[-1]%MOD)
            
