n,m=map(int,input().split())
a = [0]*n
for i in range(m):
  a[int(input())-1] = 1

s=[0]*n
if a[0] == 1:
  s[0] = 0
  s[1] = 1
elif a[1] == 1:
  s[0] = 1
  s[1] = 0
elif a[0]==1 and a[1] == 1:
  s[0] = 0
  s[1] = 0
else:
  s[0] = 1
  s[1] = 2
  
for i in range(2,n):
  #壊れている
  if a[i] == 1:
    s[i] = 0
  else:
    s[i] = s[i-1]+s[i-2]
print(s[n-1]%1000000007)
