def func(n):
    if n>=3:
        return (func(n-1)%(10**9+7)+func(n-2)%(10**9+7))%(10**9+7)
    elif n==2:
        return 2
    else:
        return 1

N, M = map(int, input().split())
if M:
    a=[]
    for _ in range(M):
        a.append(int(input()))



    a=[-1]+a+[N+1]
    answer=1
    for i in range(M+1):
        if a[i+1]-a[i]==1:
            print(0)
            break
        answer=( func(a[i+1]-a[i]-2)*answer )%(10**9+7)
    else:
        print(answer)

else:
    print(func(N))
