n, m=map(int, input().split())

from itertools import product

def mat2_mul(X, Y):
    Z = [ [0, 0], 
          [0, 0] ]
    for (i,j,k) in product(range(2),range(2),range(2)):
        Z[i][j] += X[i][k] * Y[k][j]
    return Z

def mat2_pow(X, n):
    if n == 0:
        return [ [1, 0],
                 [0, 1] ]
    elif n % 2:
        return mat2_mul(X, mat2_pow(X, n-1))  
    else:
        half_pow = mat2_pow(X, n/2)
        return mat2_mul(half_pow, half_pow)

def fb(n):
    if n == 0:
        return 0
    else:
        F = [ [0, 1],
              [1, 1] ]
        return mat2_pow(F, n-1)[1][1]
l=[]
for _ in range(m):  
  l.append(int(input()))
ans=fb(l[0])
#print(ans)
for i in range(m-1):
  if l[i]+1==l[i+1]:
    print(0)
    exit()
  elif l[i+1]-l[i]>2:
    ans=ans*(fb(l[i+1]-l[i]-1))
print(ans*fb(n-l[m-1])%1000000007)
