n,m=map(int,input().split()) 
lista=[]
for i in range(m): 
	a=int(input())
	lista.append(a)

ans=1


def fb(num):
    """num番目のフィボナッチ数を返す
    """
    a, b = 1, 1
    for i in range(num):
        a, b = a + b, a
    return b
    
#print(fb(3))

if m==0:
	ans=ans*fb(n)
	
else:
	for i in range(m-1):
		if (lista[i]+1==lista[i+1])&(m>=2):
			ans=0
  	
  	
		else:
			lista.append(n)
			if lista[0]!=1:
					ans=ans*(fb(lista[0]-1))
					for i in range(1,m):
							ans=ans*(fb(lista[i]-lista[i-1]-2))
					
		 
					
			if lista[0]==1:
					for i in range(1,m):
							ans=ans*(fb(lista[i]-lista[i-1]-2))
					
		
	ans= ans*(fb(lista[m]-lista[m-1]-1))
		
print(ans%1000000007)
	