n,m=map(int,input().split())
mod=10**9+7

    
def fib(j):
    if j==1:
        return 1
    if j==2:
        return 2
    return fib(j-1)+fib(j-2)


ans=1
now=0

for i in range(m):
    a=int(input())
    if a==now:
        ans=0
        break
    if a-1==now:
        now=a+1
        continue
    ans*=fib((a-now-1))
    ans=ans%mod
    now=a+1

ans*=fib((n-now))
ans=ans%mod
print(ans)
    
