n,m=map(int,input().split())
A=[int(input()) for i in range(m)]
l=[A[i]-0 if i==0 else A[i]-A[i-1]-1 for i in range(m)]
l.append(n-A[-1])
#print(l)

def fib(N):
  ans=[]
  for i in range(N):
    if i<2:
      ans.append(1)
    else:
      ans.append(ans[i-1]+ans[i-2])
  if len(ans)==0:
    return 0
  else:
    return ans[-1]

if 1 in l[1:]:
  print(0)
else:
  lp=[fib(item) for item in l]
#print(lp)
  s=1
  for item in lp:
    s*=item
  print(s%1000000007)
