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

broken_step = []
for _ in range(M):
    broken_step.append(int(input()))
    
mod = 1000000007

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

def step_memo(N):
    if N == 0:
        return 1
    if N == 1:
        return 1

    a = 1
    b = 1
    
    if N-1 in broken_step:
        a = 0
    if N-2 in broken_step:
        b = 0
    if N in broken_step:
        a = 0
        b = 0
        
    if memo[N] != -1:
        return memo[N]
    memo[N] =  (a * step_memo(N-1) + b * step_memo(N-2)) % mod
    return (a * step_memo(N-1) + b * step_memo(N-2)) % mod
  
print(step_memo(N))
