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