mod=1000000007
N,M=map(int,input().split())
A=[]
for m in range(M):
    A.append(int(input()))

def check(A):
    for m in range(M-1):
        if A[m+1]-A[m]==1:
            return False
    return True

def fibo(n):
    if n==0 or n==1:
        return 1
    else:
        L=[1,1]
        for i in range(2,n+1):
            L=[L[-1]]+[sum(L)]
        return L[-1]

def main(A,N):
    if check(A)==False:
        return 0
    else:
        A=[0]+A+[N+1]
        B=[A[n+1]-A[n]-2 for n in range(M+1)]
        x=1
        for b in B:
            x*=fibo(b)
        return x%mod

print(main(A,N))