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

"""
DPを考える
"""

result = [0] * (N+1)
result[0] = 1
mod = 10**9 + 7
for i in range(N+1):
    if i not in A:
        if i >= 2:
            result[i] = (result[i-1] + result[i-2])%mod
        if i == 1:
            result[i] = 1

print(result[N])