mod=1000000007
def Fib(n):
  a, b = 1, 2
  if n == 1 or n==0:
    return a
  elif n == 2:
    return b
  else:
    for i in range(n-2):
      a, b = b%mod, (a+b)%mod
    return b
n,m=map(int,input().split())
al=[]
zeroflag=0
fa=-1
cnt=0
for iii in range(m):
  a=int(input())
  cnt+=1
  al.append(a)
  if abs(fa-a)==1:
    zeroflag=1
  fa=a

if zeroflag==1:
  print(0)
else:
  ans=1
  for iii in range(m):
    if iii==0:
      ans=Fib(al[iii]-1)
    if iii==m-1:
      break
    if len(al)>1:  
      num=Fib(al[iii+1]-al[iii]-2)
      ans*=num%mod
  ans*=Fib(n-al[-1]-1)%mod
  print(ans%mod)