n,m=map(int,input().split())
A=[]
count=[]
for i in range(m):
  a=int(input())
  if a-1 in A:
    print(0)
    break
  A.append(a)
A.append(0)
A.append(n)
A=sorted(list(set(A)))
for i in range(len(A)-1):
  a=1
  b=1
  for j in range(A[i+1]-A[i]-1):
    a=b%((10**9)+7)
    b=(a+b)%((10**9)+7)
  count.append(a)
Total=1
for i in range(len(count)):
  Total*=count[i]%((10**9)+7)
print(Total%((10**9)+7))