n, m = [int(x) for x in input().split()]
a_list = [0] * m
for i in range(m):
    a_list[i] = int(input())

mod = 1000000007

temp_list = [0] * (n + 1)
temp_list[0] = 1
if a_list[0] != 1:
    temp_list[1] = 1
    j = 0
else:
    j = 1

for i in range(2, n + 1):
    if j < m and i == a_list[j]:
        j += 1
        continue
    temp_list[i] = (temp_list[i - 2] + temp_list[i - 1]) % mod
print(temp_list[n])