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

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

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)
