def Fib(n):
  a,b = 1,2
  if n == 1:
    return a
  elif n == 2:
    return b
  else:
    for i in range(n-2):
      a,b = b,a+b
    return b
N,M = map(int,input().split())
a = list()
flag = True
su = 0
kai = 0
for i in range(M):
  b = int(input())
  a.append(b)
for i in range(M-1):
  if a[i] == a[i+1]:
    flag = False
if flag == True:
  if a[0] != 1:
    for i in range(M):
      su += Fib(a[i]-1-kai)%(10**9+7)
      su %= 10**9 + 7
      kai = a[i]
    su += Fib(N-a[-1] -1)%(10**9+7)
    su %= (10**9+7)
  #else:
    
    
    
print(su)