import numpy
N,M=map(int,input().split())
a=[0]*M
tori=[0]*N
for num in range(M):
    a[num]=int(input())
count=0

def saiki(gen):
    global count
    if gen+1==N:
        count=count+1
        return
    else:
        saiki(gen+1)
    if gen+2==N:
        count=count+1
        return
    else:
        saiki(gen+2)

def fib(mae,hutatu,gen):
    global tori
    tori[gen-1]=mae+hutatu
    if(gen==N):
        return tori[gen-1]
    fib(tori[gen-1],tori[gen-2],gen+1)

tori[0]=1
tori[1]=2
if(1 in a):
    tori[0]=0
    tori[1]=1
if(2 in a):
    tori[1]=0
gen=3
while(gen<=N):
    tori[gen-1]=(tori[gen-2]+tori[gen-3])%1000000007
    if(gen in a):
        tori[gen-1]=0
    #print(tori[gen-1])
    gen=gen+1

print(tori[N-1])
#print(fib(1,1,3))