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

fib=[0,1,2]
for j in range(2, 100000):
    fib.append(fib[j]+fib[j-1])


if min(c)==0:
    if c.count(0)==1 and c[0]==0:
            ans=1
            for k in c[1:]:
                ans=(ans*fib[k])
            print(ans)
    else:
        print(0)
else:
    ans=1
    for k in c:
        ans=(ans*fib[k])
    print(ans%1000000007)

