import sympy as sym
def FibRe(n):
    x = sym.symbols('x',nonnegative=True,integer=True)
    Fib=1/sym.sqrt(5)*(((1+sym.sqrt(5))/2)**(n-1)-((1-sym.sqrt(5))/2)**(n-1))
    result=Fib.subs(x,n)
    result=result.evalf(int(n*3/14)+1)
    return int(result)

N,M = map(int,input().split())
if M == 0:
  print(FibRe(N+2))
else:
  S = []
  for _ in range(M):
    S.append(int(input()))
  S.append(-1)
  S.append(N+1)
  S.sort()  
  P = 1

  for i in range(M+1):
    P *= FibRe(S[i+1]-S[i]) 

  print(P%1000000007)