N, M = map(int, input().split())
bre = []
A = [1] * 10000
A[0] = 0
for i in range(M):
    a = int(input())
    A[a+1] = 0
#print(bre)
for i in range(2, N+2):
    if A[i] == 0:
        continue
    A[i] = A[i-1]+ A[i-2]
    A[i] = A[i] % 1000000007
    #print(A)
print(A[N+1])



