import numpy as np
import math

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

aList = [int(input()) for _ in range(M)]

trg = np.ones(N+1, dtype = np.int64)
dp = np.zeros(N+1, dtype = np.int64)

for a in aList:
    trg[a] -= 1


for i in range(1, N+1):
    if(i <= 2):
        dp[i] = (dp[i-1] + 1) * trg[i]
    
    else:
        dp[i] = (dp[i-1] + dp[i-2]) * trg[i]

print(dp[N] % 1000000007)
