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

mod = 1000000007

result = [-1]*(N+1)

result[0] = 1
result[1] = 1

for a in a_list:
    result[a] = 0

for i in range(2, N+1):
    if i not in a_list:
        result[i] = (result[i-1]+result[i-2])%mod
        if result[i] == 0:
            result[-1] = 0
            break
    
print(result[-1])