div = 1000000007
N,M = map(int,input().split())
A = []
for i in range(M):
    A.append(int(input()))
flag = False
step = [0]*N
step[0:2] = [1,1]
for i in range(2,N):
    step[i] = (step[i-1]+step[i-2])%div
if M == 0:
    ans = step[N-1]%div
else:
    ans = (step[A[0]-1])%div
    for i in range(1,M):
        tmp = A[i] - A[i-1]
        if tmp == 1:
            flag = True
            break
        else:
            ans = (ans*step[tmp-1])%div
    ans = (ans*step[N-A[M-1]-1])%div
if flag: ans = 0
print(ans)