n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]
   
s = [0 if n-i in a else -1 for i in range(n+1)] 
s[0] = s[1] = 1

for i in range(2, n+1):
    if s[i] == 0:
        continue
    s[i] = (s[i-1] + s[i-2]) % 1000000007

if s[n] < 0:
    print(0)
else:
    print(s[n])