n, m = map(int, input().split())
mod = 10 ** 9 + 7
a = []
for i in range(m):
    a.append(int(input()))

dp = [-1] * (n + 1)


def dfs(step):
    if dp[step] >= 0:
        return dp[step]
    if step - 1 in a and step - 2 in a:
        return 0
    cnt = 0
    if step <= 0:
        return 1
    if step - 1 >= 0 and step - 1 not in a:
        cnt += dfs(step - 1)
    if step - 2 >= 0 and step - 2 not in a:
        cnt += dfs(step - 2)
    dp[step] = cnt
    return cnt % mod


print(dfs(n))
