n,m = map(int,input().split())
broken = [None for _ in range(m)]

dp = [0,1,2,3,5,8]
def getdp(x):
  while len(dp) <= x:
    dp.append(dp[-2]+dp[-1])
  return dp[x]

def solve(broken):
  
  ans = 1
  for i in range(m):
    broken[i] = int(input())
    if i>0:
      if broken[i-1] + 1 is broken[i]:
        return 0
  broken = [-1] + broken + [n+1]
  for i in range(1,m+2):
    if broken[i]-broken[i-1]-2 <= 0:
      continue
    ans *= getdp(broken[i]-broken[i-1]-2) 
    ans %= 1000000007
  return ans

print(solve(broken))