def step(n) :
  if(n <=2) :
    return n
  else :
    return step(n - 1) + step(n - 2)

N, M = map(int, input().split())
a = [int(input()) for i in range(M)]
S = 0

for i in range(M - 1) :
  if(M != 1) :
    if(a[i + 1] - a[i] == 1) :
      pass
    else :
      for j in range(M + 1) :
          if(j == 0) :
            S += step(a[j] - 1)
          elif(j == M) :
            S += step(N - a[j - 1] - 1)
          else :
            x = a[j] - a[j - 1] - 1
            S += step(x)
    
print(S % 1000000007)