import sys
big=10**9+7

def modsum(a,b):
  return a%big + b%big

n,m = map(int, input().split())
n+=1

a = [0]*m
for i in range(m):
  a[i] = int(input())
  
#連続こわれ
for i in range(m-1):
  if a[i]+1 == a[i+1]:
    print(0)
    sys.exit(0)

#選択肢計算
cho = [1]*n
if 1 in a:
  cho[1]=0

for i in range(2,n):
  if i in a:
    cho[i] = 0
  elif i-1 in a:
    cho[i] = cho[i-2]
  else:
    cho[i] = modsum(cho[i-1], cho[i-2])


print(cho[-1]%big)
