N_M = [int(e) for e in input().split()]
div = 1000000007
a=[]
for i in range(N_M[1]):
  a.append(int(input()))

stair = []
for i in range(N_M[0]+1):
  stair.append(i)

stairs = [[]]
start=0
for i in range(len(a)+1):
  if(i==len(a)):
    stairs.append(stair[start:N_M[0]+1])
    break
  stairs.append(stair[start:a[i]])
  start=a[i]+1

stairs = [x for x in stairs if x]

def num(stair):
  number=0
  if(stair==0):
    return 1
  elif(stair==1):
    return 1
  elif(stair==2):
    return 2
  elif(stair>2):
    number += num(stair-1)
    number += num(stair-2)
    
  return number

answers = []
for i in range(len(stairs)):
  answers.append(num(len(stairs[i])-1))

answer=1
for i in range(len(answers)):
  answer *= answers[i]

print(answer%div)