def fibo(x):
    if x>0:
        ll=[0]*x
        ll[0]=1
        if x>1:
            ll[1]=2
            if x>2:
                for y in range(x-2):
                    ll[y+2]=ll[y+1]+ll[y]
        return(ll[x-1])

    else:
        return(0)

N,M=(int(x) for x in input().split())
a=[]
for x in range(M):
    aa=int(input())
    a.append(aa)
ans=[0]*(M+1)
sa=a[0]-1
if sa>0:
    ans[0]=fibo(sa)
else:
    ans[0]=1
for x in range(M-1):
    sa=a[x+1]-a[x]-1
    if sa>0:
        ans[x+1]=fibo(sa-1)
    else:
        ans[x+1]=0
        break

saa=N-a[M-1]-1
ans[M]=fibo(saa)

kotae=ans[0]%1000000007
for x in range(M):
    kotae=kotae*int(ans[x+1])%1000000007
print(kotae%1000000007)
