N, M = [int(nm) for nm in input().split()]

import math
a_1 = -1
nm_of_cs = 1
for m in range(M+1):
  a_0 = a_1
  if m < M:
    a_1 = int(input())
  else:
    a_1 = N+1
  if a_0 + 1 == a_1:
    nm_of_cs = 0
    break
  d_01 = (a_1 - 1) - (a_0 + 1)
  if d_01 % 2 == 0:
    nm_of_cs *= 2**(d_01 // 2)
  else :
    cs = 0
    for i in range(d_01//2 + 1):
      cs += math.factorial(d_01-i)/(math.factorial(i) + math.factorial(d_01-i*2))
    nm_of_cs *= cs

ans = nm_of_cs % 1000000007
print(ans)