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=sorted(list(set(A)))
c=1
d=1
for i in range(A[0]-1):
  c=d%(10**9+7)
  d=(c+d)%(10**9+7)
count.append(c)
if m>1:
  for i in range(1,len(A)-1):
    e=1
    f=1
    for j in range(A[i+1]-A[i]-2):
      e=f%(10**9+7)
      f=(e+f)%(10**9+7)
    count.append(e)
a=1
b=1
for i in range(n-A[-1]-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))