n,m = map(int,input().split())
way = [1 for _ in range(n+1)]
b1 = 1
b2 = 1
count = 1
ai = int(input())
if ai == 1:
  b2 = 0
  ai = int(input())
  count += 1
for i in range(2,n+1):
  if i == ai:
    b1 = b2
    b2 = 0
    if count < m:
      ai = int(input())
      count+=1
  else:
    tmp = b2
    b2 = (b1 + tmp)%1000000007
    b1 = tmp
print(b2)    