a,b = map(int,input().split())
s =[0]*(b+1)
flag = 0
p = [0]*b
goukei = 0
for i in range(b):
  p[i] = int(input())
for k in range(1,b):
  if (p[k] - p[k-1]-1) == 0:
    flag = 1
for l in range(b+1):
  if l == 0:
    s[l] = p[l] -1
  elif l == b:
    s[l] = a - p[l-1]-1
  else:
    s[l] = p[l] - p[l-1]-1
counter = 0
def fib1(n):
    global counter
    counter += 1
    if n in [0, 1]:
        return 1
    return fib1(n - 1) + fib1(n - 2)
if flag == 0:
  for f in range(len(s)):
    goukei += fib1(s[f])
  print(goukei%1000000007)
else:
  print(0)