from scipy.misc import comb

def LI():
  return [int(s) for s in input().split()]

def dansu(a,b):
    one_count = b - a
    two_count = 0
    count = 1
    for i in range((b-a) // 2):
        one_count -= 2
        two_count += 1
        count += comb(one_count+two_count,one_count,exact = True)
        
    return count
        
N,M = LI()
MOD = 10**9 + 7

total_count = 1

m1 = 0
#m2 = int(input())

total_count = 1

#m1 = m2 + 1

for i in range(M+1):
  
  if i == 0:
    m1 = 0
  m2 = N if i == M else (int(input()) - 1)

  if m2 - m1 <= 0 and i != 0:
    print(0)
    exit()
    
  total_count = (total_count * dansu(m1,m2)) % MOD
  m1 = m2 + 2
  
print(total_count % MOD)