from collections import deque
N,M=map(int,input().split())
broken=[]
for i in range(M):
  broken.append(int(input()))
ans=0
def dfs(start,goal,ans,d):
  if len(d)==0:
    return ans
  now=d.pop()
  if now==goal:
    ans+=1
    return dfs(start,goal,ans,d)
  else:
    if (now+1 in broken) and (now+2 in broken):
      return 0 
    else:
      if now+1 not in broken:
        if now+1<=goal:
          d.append(now+1)
      if now+2 not in broken:
        if now+2<=goal:
          d.append(now+2)
      return dfs(start,goal,ans,d)
V=1
for i in range(M):
  d=deque()
  if i==0:
    start=0
    goal=broken[i]-1
    d.append(start)
    V*=dfs(start,goal,ans,d)
  else:
    start=broken[i-1]+1
    goal=broken[i]-1
    d.append(start)
    V*=dfs(start,goal,ans,d)
Start=broken[i]+1
Goal=N
d_=deque()
d_.append(Start)
V*=dfs(Start,Goal,ans,d_)
print(V%(10**9+7))