n,m=map(int,input().split())
a=[]
for i in range(m):
    a.append(int(input()))
res=1
count=0
for i in range(n):
    if i+1 in a and i+2 in a:
            res=0
            break
    else:
        if i not in a:
            if i<n-1:
                if i+1 not in a:
                    count+=1
                if i+2 not in a:
                    count+=1
                res=res*count
                print(count)
                count=0
print((res)%1000000007)