N, M = map(int, input().split())
broken = [False for _ in range(10 **5)]
for _ in range(M):
    a = int(input())
    broken[a] = True

INF = 1000000007

memo = [None for _ in range(N + 1)]
if not broken[1]:
    memo[1] = 1
else:
    memo[1] = 0
if not broken[2]:
    memo[2] = 2
else:
    memo[2] = 0
for i in range(3, N + 1):
    if broken[i]:
        memo[i] = 0
        continue
    memo[i] = (memo[i - 2] + memo[i - 1]) % INF

print(memo[N])
