N,M=map(int,input().split())
a = []
for i in range(M):
  tmp = int(input())
  a.append(tmp)

flag = 1
# 連続して床が壊れている場合はたどり着けない
for i in range(M-1):
  if a[i+1]-a[i] == 1:
    flag = 0
    break
    
if flag == 0:
  print(0)
else:
  pos = 0
  count = 0
  
  for i in range(M):
    diff = a[i] - pos - 1
    if diff > 0:	# 現在地の次の次の段以上が壊れている場合
      two_step = 1
      count += 1
      while 2*two_step <= diff:
        tmp = 1
        for j in range(diff-two_step, 0, -1):
          tmp *= j
        for j in range(two_step, 0, -1):
          tmp /= j
        count += tmp
        two_step += 1
      pos += (diff+2)
    else:		# 現在地の次の段が壊れている場合
      count += 1
      pos += 2

  diff = N - pos
  two_step = 1
  count += 1
  while 2*two_step <= diff:
    tmp = 1
    for j in range(diff-two_step, 0, -1):
      tmp *= j
    for j in range(two_step, 0, -1):
      tmp /= j
    count += tmp
    two_step += 1
  print(int(count%(10**9+7)))
    
      

