def fib2(n):
    f = ((1 + 5**0.5) / 2)**n / 5**0.5 + 0.5
    return int(f)

inp = input()
n = int(inp.split()[0])
m = int(inp.split()[1])
a = []
for i in range(m):
  a.append(int(input()))
  
mul_list = []
nochance = False
for j in range(m+1):
  if j == 0:
    ss = a[0]
    if ss <= 0:
      p = 1
    else:
      p = fib2(ss)
    mul_list.append(p)
  elif j == m:
    step = n - a[-1]
    p = fib2(step)
    mul_list.append(p)
  else:
    step = a[j] - a[j-1] - 1
    if step == 0:
      nochance = True
      break
    p = fib2(step)
    mul_list.append(p)
    

if nochance:
  print(0)
else:
  ans = 1
  for b in mul_list:
    ans *= b
  print(ans%1000000007)