n,m=map(int,input().split())
def cbn(l):
    if l<3:
        return(max(1,l))
    else:
        return(cbn(l-1)+cbn(l-2))
ans=1
a=-1
for i in range(m):
    now=a+1
    a=int(input())
    if now==a:
        print(0)
        exit()
    else:
        ans*=cbn(a-now-1)
ans*=cbn(n-a-1)
mod=10**9+7
print(ans%mod)