from sys import stdin
def main():
  N, M = map(int, stdin.readline().rstrip().split())
  paterList=[]
  Abefore=0

  a1=1
  a2=2
  for i in range(M):
    A = int(input())
    stepNum=A-Abefore
    
    if stepNum == 1:
      print("0")
      return
    elif stepNum <= 3:
      paterList.append(stepNum-1)
    else:
      an2=a1
      an1=a2
      for j in range(stepNum -1-2):
        patern += an2+an1
        an2 = an1
        an1 = patter
      paterList.append(patern//1000000007 )
  print(sum(paterList)//1000000007)
      
input = lambda: stdin.readline()
main()
