N,M = map(int,input().split())
a = []
DP = [0 for i in range(N)]
for i in range(M):
    a += [int(input())]

if N == 1:  print(1)
elif N == 2:
    if 1 in a:  print(1)
    else:   print(2)
else:
    if 1 not in a:  DP[0] = 1
    if 2 not in a:  DP[1] = 1 + DP[0]
    
    for i in range(2,N):
        if i+1 not in a:    DP[i] = DP[i-2] + DP[i-1]

print( int(DP[N-1]%1000000007) )