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


MOD = 1000000007
print(MOD)

d = [0] * (N+1)
d[0] = 1
d[1] = 1

for i in range(2,N+1):
    if(i in a):
        d[i] = 0
    else:
        d[i] = d[i-1] + d[i-2]

print(d[-1] % MOD)