n, m = map(int, input().split())
p = 1000000007
aaa = [0] * (n + 1)
f = [0] * (n + 1)
for _ in range(m):
    x = int(input())
    aaa[x] = 1
f[0] = 1
f[1] = 1
for i in range(1, n + 1):
    f[i] = (f[i - 1] + f[i - 2]) % p
    if aaa[i] == 1:
        f[i] = 0
print(f[n])