n,m=map(int,input().split())
fib=[1]
a=1
b=1
for i in range(n):
    fib.append(b)
    c=b
    b+=a
    a=c

total=1
cannot=0
s=-1
for i in range(m):
    t=int(input())
    if t-s == 1:
        cannot+=1
        break
    else:
        total*=fib[t-s-2]
        total%=10**9+7
    s=t



if n+1-t <= 1:
    cannot+=1
else:
    total*=fib[n-t-1]
    total%=10**9+7

if cannot != 0:
    print(0)
else:
    print(total)