n,m = map(int, input().split())
list = []
for i in range(m):
  list.append(int(input()))

diff_list = []
before_pos = 0
for i in range(m):
  if before_pos == 0:
    diff_list.append(list[i]-before_pos)
  else:
    diff_list.append(list[i]-before_pos-2)
  before_pos = list[i]
diff_list.append(n-before_pos-1)

max_num = max(diff_list)

ncklist=[]
ncklist.append(0)
for i in range(max_num+1):
  if i == 1:
    ncklist.append(1)
  if i == 2:
    ncklist.append(2)
  if i > 2:
    ncklist.append(ncklist[i-1]+ncklist[i-2])

ptn = 1
for i in diff_list:
  ptn = ptn * ncklist[i]
  if i < 0:
    ptn = 0
mod = ptn % 1000000007
print(mod)