from collections import deque

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

tmp = [0 for _ in range(N + 1)]

now = 0

if 1 not in A:
    tmp[1] = 1
    
else:
    now += 1
    
if 2 not in A and N >= 2:
    tmp[2] = tmp[1] + 1
    
else:
    now += 1


for i in range(3, N+1):
    
    if i != A[now]:
        tmp[i] = tmp[i-1] + tmp[i-2] 
        
    else:
        if now < M - 1:
            now += 1
        

    
print(tmp[-1]%(10**9+7))


