N,M=map(int,input().split())
num=[0]*(N+1)
num[0]=1
num[1]=1

A=[]
for i in range(M):
    A.append(int(input()))

P=10**9+7

if 1 in A:
    num[1]=0

if N>=2:
    for i in range(2,N+1):
        num[i]=(num[i-1]+num[i-2])%P
        if i in A:
            num[i]=0

print(num[N])