n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
def fibonacci_dp(n):
    F = [1,1]
    for i in range(1,n-1):
        F.append((F[i]%(10**9+7)+F[i-1]%(10**9+7))%(10**9+7))
    return F[-1]

if n==1:
    print(1)
if n==2:
    if m==1:
        print(1)
    else:
        print(2)
else:
    for i in range(m):
        if a[i]+1 in a or a[i]-1 in a:
            print(0)
            exit()
    if m==0:
        print(fibonacci_dp(n+1))
    else:
        x=fibonacci_dp(min(a))
        a.append(n+1)
        for i in range(1,len(a)):
            x=(x*fibonacci_dp(a[i]-a[i-1]-1))%(10**9+7)
        print(x)