N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

if 1 in a and 2 in a:
  print(0)
elif 1 in a:
  k = [0, 1]
elif 2 in a:
  k = [1, 0]
else:
  k = [1, 2]

for i in range(3, N+1): #インデックスは-1
  if i in a:
    k.append(0)
  else:
    k.append(k[i-3]+k[i-2])
    
print(k[-1]%1000000007)