n, m = map(int, input().split())

a = [0] * m

for i in range(m):
    a[i] = int(input())

mod = 10 ** 9 + 7
f = [0] * (n + 1)

f[0] = 1
f[1] = 1

for i in range(2, n + 1):
    f[i] = f[i - 1] + f[i - 2]
    f[i] %= mod
    if i in a:
        f[i] = 0

print(f[n])
