if __name__ == "__main__":
    mod = 10 ** 9 + 7
    n, m = map(int, input().split())
    a = list()
    for i in range(m):
        a.append(int(input()))

    dp = [0] * (n + 1)

    step = list()
    for i in range(n):
        if i not in a and i > 2:
            step.append(i)

    if 1 not in a:
        dp[1] = 1

    if n > 1:
        if 2 not in a:
            dp[2] = 1 + dp[1]

        for i in step:
            dp[i] = (dp[i-2] + dp[i-1]) % mod

    print(dp[n])
