N,M = list(map(int, input().split()))
 
lst1 = [int(input()) for i in range(M)]
 
def fib(n):
  lst = []
  a = 1
  for i in range(1,n+1):  
    if (i == 1):
      if (i in lst1):
        a = 0
      lst.append(a)
    elif (i == 2):
      if (i in lst1):
        lst.append(lst[0])
      else:
        lst.append(lst[0] + 1)
    else:
      if (i in lst1):
        lst.append(0)
      else:
        lst.append(lst[i-3] + lst[i-2])
  return lst[-1]
print(fib(N) % 1000000007)