n,m=map(int,input().split())
a=[]
for i in range(m):
    a.append(int(input())-1)
cnt=[0]*n
if 0 not in a:
    cnt[0]=1
    if 1 not in a:
        cnt[1]=2
    else:
        cnt[1]=0
else:
    cnt[0]=0
    if 1 not in a:
        cnt[1]=1
    else:
        print(0)
        exit()
for i in range(2,n):
    if i in a:
        cnt[i]=0
    else:
        if i-1 in a and i-2 in a:
            print(0)
            exit()
        elif i-1 in a:
            cnt[i]=cnt[i-2]
        elif i-2 in a:
            cnt[i]=cnt[i-1]
        else:
            cnt[i]=cnt[i-1]+cnt[i-2]
    cnt[i]%=10**9+7
print(cnt[n-1])