n,m=map(int,input().split())
li=[]
for i in range(m):
    li.append(int(input()))

def convi(li):
    m=max(li)
    a=[1,2]
    if m>2:
        for i in range(2,m+1):
            a.append(a[i-2]+a[i-1])
    ans=1    
    for j in li:
        ans=ans*a[j-1]%1000000007
    return ans


def count(li,n):
    t=0
    ans=1
    li2=[]
    for i in range(1,n+1):
        if i in li:
            if i+1 in li:
                return(0)
            else:
                li2.append(t)
                t=1
        else:
            t+=1
    if t>0:        
        li2.append(t)   

        
    print(li2)
        
    return convi(li2)

                

print(count(li,n)%1000000007)   