def fib2(n):
    if n <= 1:
        return n
    result = [1, 0, 0, 1]
    matrix = [1, 1, 1, 0]
    while n > 0:
        if n % 2:
            result = mul(matrix, result)
        matrix = mul(matrix, matrix)
        n //= 2
    return result[2]

def mul(a, b):
    return [a[0]*b[0] + a[1]*b[2],
            a[0]*b[1] + a[1]*b[3],
            a[2]*b[0] + a[3]*b[2],
            a[2]*b[1] + a[3]*b[3]]

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)
