def fb(n):
  if n > 2:
    return fb(n - 1) + fb(n - 2)
  elif n == 2:
    return 2
  elif n == 0:
    return 0
  else:
    return 1

N,M = map(int,input().split())

B = []
for i in range(M):
  b.append(int(input()))

po =[fb(B[0] - 1)]          

j = 1
for j in range(M - 1):
  po.append(fb(B[j] - B[j - 1] - 2))
  
po.append(fb(N-B[M - 1]- 1))
  
ans = reduce(lambda x,y: x * y,po)
answer = ans % 1000000007
print(answer)
  
  
  