N, M = map(int, input().split())

a = [0] * M
for i in range(M):
    a[i] = int(input())
    



memo = [-1] * (N+1)
memo[0] = 1

for i in range(M):
    memo[a[i]] = 0


for i in range(1,N+1):
    if i == 1:
        memo[i] = memo[i-1]
    if memo[i] >= 0:
       memo[i] = 0
        ## memo[i] i 番目の階段にいくまでのルート数
    else:
          memo[i] = memo[i-1] +memo[i-2]


print(memo[N] % 1000000007)