N,M=map(int,input().split())
a=[0]*(N+1)
b=[0]*(M+2)
c=[0]*(M+2)
a[0]=0
a[1]=1
a[2]=1
for i in range(3,N+1):
    a[i]=a[i-1]+a[i-2]
b[0]=-1
b[M+1]=N+1
way=1
for i in range(1,M+1):
    b[i]=int(input())
    c[i]=b[i]-b[i-1]-1
    way=(way*a[c[i]])%1000000007
c[M+1]=b[M+1]-b[M]-1
way=(way*a[c[M+1]])%1000000007
print(way)