N, M = map(int, input().split())
A = [0] * M
B = [0] * N

if M ==0:
  B[0] = 1
  B[1] = 2
  for i in range(2,N):
    B[i] = B[i-1]+B[i-2]
  print(B[N-1])
  exit()
elif M == 1:
  A[0] = int(input())
  if A[0] == 1:
    B[0] = 0
    B[1] = 1
  elif A[0] == 2:
    B[0] = 1
    B[1] = 0

  for i in range(2,N-1):
    B[i] = B[i-1]+B[i-2]
  print(B[N-2])
  exit()
  


for i in range(M):
  A[i] = int(input())
  


count = [0] * N
dame = M-1
if A[M-1] == N-1 and A[M-2] == N-2:
  count[N-1] = 0
  count[N-2] = 0
  dame -= 2
elif A[M-1] == N-1:
  count[N-1] = 0
  count[N-2] = 1
  dame -= 1
elif A[M-1] == N-2:
  count[N-1] = 1
  count[N-2] = 0
  dame -= 1
else:
  count[N-1] = 1
  count[N-2] = 2

#print(count[N-1])
#print(count[N-2])

for i in range(N-3, -1, -1):
  if A[dame] == i:
#    print('dame_' + str(dame))
#    print(A[dame])
    count[i] = 0
    dame -= 1
  else:
    count[i] = (count[i+1] + count[i+2] ) % 1000000007
#    print(count[i])

#  if i % 10 == 0:
#    print(count[i])
#  print('i_ ' + str(i))
#  print(count[i])
result = count[0] % 1000000007
print(result)