#C問題
mod = 10**9+7
N,M = map(int,input().split())

step = []
for i in range(N+1):
    if i <= 1:
        step.append(1)
    elif i == 2:
        step.append(1)
    else:
        step.append(step[i-1]+step[i-2])
    
A = []
for j in range(M):
    A.append(int(input()))

stairs = []
nowlen = 1
flag = 0
for i in range(N):
    I = i+1
    if I in A:
        if nowlen == 0:
            flag = 1
            break
        stairs.append(nowlen)
        nowlen = 0
    else:
        nowlen+=1
stairs.append(nowlen)
if flag == 1:
    print(0)
else:
    ans = 1
    for s in stairs:
        ans*=step[s]
        
    print(ans%mod)
    
    
    