N, M = map(int, input().split())
mae = 0
sub = []
flag = False

for _ in range(M):
  broken = int(input())
  if mae == broken: # 不可能
    flag = True
  if flag:
    continue
  if mae+1 == broken:
    mae = broken + 1
    continue
  sub.append(broken-1-mae)
  mae = broken + 1
# 無理な時
if flag:
  print(0)
  exit()
# forの中で最後まで行ってない分の追加
if mae != N:
  sub.append(N-mae)

from operator import mul
from functools import reduce

# nCrの関数
def C(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom
# 壊れてるやつの間の上り方の場合の数
def count(n):
  ans = 1
  for i in range(n//2):
    ans += C(n-i-1, i+1)
  return ans

ans = 1
waru = 10**9+7
for s in sub:
  ans *= count(s)%waru
print(ans%waru)