N, M = map(int, input().split())
MOD = 10 ** 9 + 7
s = 0

def comb(n, k):
  if k > n - k:
    k = n - k
  de = 1
  nu = 1
  for i in range(k):
    de *= (n - i)
    de = de % MOD
    nu *= (i + 1)
    nu = nu % MOD
  nu = pow(nu, -1, MOD)
  return (de * nu) % MOD

def calc_from_step(step):
  temp = 0
  for i in range(1 + (step // 2)):
    temp += comb(step-i, i)
  return temp


arr = [1, 1]
steps = []
step = 0
s = 0
for i in range(M):
  l = int(input()) - 1
  steps.append(l-s)
  if s > l:
    print(0)
    exit()
  if step < l - s:
    step = l - s
  s = l + 2
l = N
steps.append(l-s)
if step < l - s:
  step = l - s

for i in range(step - 1):
  arr.append((arr[i] + arr[i+1])%MOD)
ans = 1

for i in steps:
  ans *= arr[i]
  ans = ans % MOD
print(ans) N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 s = 0 s 0 def comb(n, k):
  if k > n - k:
    k = n - k
  de = 1
  nu = 1
  for i in range(k):
    de *= (n - i)
    de = de % MOD
    nu *= (i + 1)
    nu = nu % MOD
  nu = pow(nu, -1, MOD)
  return (de * nu) % MOD comb if k > n - k:
    k = n - k
   k > n - k k n - k n k k = n - k k n - k n k de = 1 de 1 nu = 1 nu 1 for i in range(k):
    de *= (n - i)
    de = de % MOD
    nu *= (i + 1)
    nu = nu % MOD
   i range(k) range k de *= (n - i) de n - i n i de = de % MOD de de % MOD de MOD nu *= (i + 1) nu i + 1 i 1 nu = nu % MOD nu nu % MOD nu MOD nu = pow(nu, -1, MOD) nu pow(nu, -1, MOD) pow nu -1 MOD return (de * nu) % MOD (de * nu) % MOD de * nu de nu MOD n n k k def calc_from_step(step):
  temp = 0
  for i in range(1 + (step // 2)):
    temp += comb(step-i, i)
  return temp calc_from_step temp = 0 temp 0 for i in range(1 + (step // 2)):
    temp += comb(step-i, i)
   i range(1 + (step // 2)) range 1 + (step // 2) 1 step // 2 step 2 temp += comb(step-i, i) temp comb(step-i, i) comb step-i step i i return temp temp step step arr = [1, 1] arr [1, 1] 1 1 steps = [] steps [] step = 0 step 0 s = 0 s 0 for i in range(M):
  l = int(input()) - 1
  steps.append(l-s)
  if s > l:
    print(0)
    exit()
  if step < l - s:
    step = l - s
  s = l + 2 i range(M) range M l = int(input()) - 1 l int(input()) - 1 int(input()) int input() input 1 steps.append(l-s) steps.append steps append l-s l s if s > l:
    print(0)
    exit()
   s > l s l print(0) print 0 exit() exit if step < l - s:
    step = l - s
   step < l - s step l - s l s step = l - s step l - s l s s = l + 2 s l + 2 l 2 l = N l N steps.append(l-s) steps.append steps append l-s l s if step < l - s:
  step = l - s step < l - s step l - s l s step = l - s step l - s l s for i in range(step - 1):
  arr.append((arr[i] + arr[i+1])%MOD) i range(step - 1) range step - 1 step 1 arr.append((arr[i] + arr[i+1])%MOD) arr.append arr append (arr[i] + arr[i+1])%MOD arr[i] + arr[i+1] arr[i] arr i arr[i+1] arr i+1 i 1 MOD ans = 1 ans 1 for i in steps:
  ans *= arr[i]
  ans = ans % MOD i steps ans *= arr[i] ans arr[i] arr i ans = ans % MOD ans ans % MOD ans MOD print(ans) print ans N, M = map(int, input().split()) map(int, input().split()) N s = 0 0 s step = l - s l - s step arr = [1, 1] [1, 1] arr l = int(input()) - 1 int(input()) - 1 l s = l + 2 l + 2 s M = map(int, input().split()) map(int, input().split()) M MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD step = l - s l - s step l = N N l steps = [] [] steps def calc_from_step(step):
  temp = 0
  for i in range(1 + (step // 2)):
    temp += comb(step-i, i)
  return temp def calc_from_step(step):
  temp = 0
  for i in range(1 + (step // 2)):
    temp += comb(step-i, i)
  return temp calc_from_step ans = 1 1 ans ans *= arr[i] arr[i] ans ans = ans % MOD ans % MOD ans def comb(n, k):
  if k > n - k:
    k = n - k
  de = 1
  nu = 1
  for i in range(k):
    de *= (n - i)
    de = de % MOD
    nu *= (i + 1)
    nu = nu % MOD
  nu = pow(nu, -1, MOD)
  return (de * nu) % MOD def comb(n, k):
  if k > n - k:
    k = n - k
  de = 1
  nu = 1
  for i in range(k):
    de *= (n - i)
    de = de % MOD
    nu *= (i + 1)
    nu = nu % MOD
  nu = pow(nu, -1, MOD)
  return (de * nu) % MOD comb step = 0 0 step s = 0 0 s
N, M = map(int, input().split())
MOD = 10 ** 9 + 7
s = 0

def comb(n, k):
  if k > n - k:
    k = n - k
  de = 1
  nu = 1
  for i in range(k):
    de *= (n - i)
    de = de % MOD
    nu *= (i + 1)
    nu = nu % MOD
  nu = pow(nu, -1, MOD)
  return (de * nu) % MOD

def calc_from_step(step):
  temp = 0
  for i in range(1 + (step // 2)):
    temp += comb(step-i, i)
  return temp


arr = [1, 1]
steps = []
step = 0
s = 0
for i in range(M):
  l = int(input()) - 1
  steps.append(l-s)
  if s > l:
    print(0)
    exit()
  if step < l - s:
    step = l - s
  s = l + 2
l = N
steps.append(l-s)
if step < l - s:
  step = l - s

for i in range(step - 1):
  arr.append((arr[i] + arr[i+1])%MOD)
ans = 1

for i in steps:
  ans *= arr[i]
  ans = ans % MOD
print(ans)