n, m = map(int, input().split())
a = [int(input()) for x in range(m)]

l = [1]
for i in range(1, n+1):
  if i in a:
    if l[i-1] != 0:
      l.append(0)
    else:
      print(0)
      exit()
  else:
    if i != 1:
      l.append(l[i-2] + l[i-1])
    else:
      l.append(1)

print(l[-1] % 1000000007)