n,m=map(int,input().split())
rt=[1,2]
mod=10**9+7
for i in range(2,n):
    rt.append(rt[i-1]+rt[i-2])
rt.insert(0,0)
a=[-1]
for _ in range(m):
    a.append(int(input()))
a.append(n+1)
ans=1

for i in range(m+1):
    if a[i+1]==1:
        continue
    ans=ans*rt[max(a[i+1]-a[i]-2,0)]%mod
print(ans)
