n,m = map(int,input().split())
a = [-1]
flag = True
for i in range(m):
  a.append(int(input()))
  if i>0 and a[i+1]==a[i]+1:
    flag = False
    break
if not flag:
  print(0)
a.append(n+1)

step = [a[i+1]-a[i]-1 for i in range(m+1)]

onestep = [1,1]
if max(step)>=3:
  for i in range(3,max(step)+1):
    onestep.append(onestep[-2]+onestep[-1])

ans = 1
for i in range(m+1):
  ans *= onestep[step[i]-1]
if flag:
  print(ans%1000000007)