n,m=map(int,input().split())
a=[]
for i in range(m):
    a.append(int(input()))
flag=0
c=[0 for i in range(n+1)]
b=0
a.append(-2)
if(m!=0):
    for i in range(m):
        if(a[i+1]-a[i]==1):
            print('0')
            flag=1
if(flag==0):
    c[0]=1
    if(a[b]==1):
        c[1]=0
        b+=1
    else:
        c[1]=1
    for i in range(2,n+1):   # iは段目
        if (i==a[b]):
            c[i]=0
            b+=1
        else:
            c[i]=c[i-1]+c[i-2]
            c[i]=c[i] %1000000007
    print('{0}'.format(c[n]))