import queue
from collections import deque



N,M = map(int,input().split(" "))
A = deque()

if(N == 1):
    print(1)
    exit()

oneBreak = False
for m in range(M):
    inp = int(input())
    if inp == 1:
        oneBreak = True
    else:
        A.append(inp)


DP = [0] * (N+1)

DP[0] = 1

if(oneBreak):
    DP[1] = 0
else:
    DP[1] = 1
#壊れている階段の時は判定をスキップ（DPテーブルは0のまま）

if(M != 0):
    nowA = A.popleft()
    for n in range(2,N + 1):
        if(nowA == n):
            if(len(A) != 0):
                nowA = A.popleft()
            else:
                nowA = -1
        else:
            DP[n]  = (DP[n-1] + DP[n-2])

else:
    for n in range(2,N+1):
        DP[n] = DP[n-1] + DP[n-2]


print(DP[n]%1000000007)
