N,M=map(int,input().split())
a=[]
for m in range(M):
    a.append(int(input()))
a=[-1]+a+[N+1]
b=[a[m+1]-a[m]-2 for m in range(M+1)]
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:
        A=[1,1]
        for i in range(2,n+1):
            A=[A[-1]]+[sum(A)]
        return A[-1]

def main():
    if check(a)==False:
        return 0
    else:
        x=1
        for _ in b:
            x*=fibo(_)
        return x

print(main()%1000000007)