N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
 
if 1 in a and 2 in a:
  print(0)
else:
  k = [0, 1]    
  for i in range(1, N+1): #インデックスは-1
    if i in a:
      k.append(0)
    else:
      sum = k[i-1] + k[i]
      k.append(sum)
      
  print(k[-1]%1000000007)