n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]
for i in range(len(a)-1):
    if a[i+1] == a[i]+1:
        print(0)
        exit()
x = [0]*(n+1)
x[0]=1
div = 1000000007

if not 1 in a:
    x[1]=1

for i in range(2,n+1):
    if not i in a:
        x[i] = (x[i-2] + x[i-1]) % div
print(x[n])