def solve():
    N, M, *a = map(int, open(0).read().split())
    MOD = 1000000007

    dp = [0 for _ in range(N+1)]
    if 1 not in a:
        dp[1] = 1
        if 2 not in a:
            dp[2] = 2
    elif 2 not in a:
        dp[2] = 1

    for i in range(3, N+1):
        dp[i] = (dp[i-1] + dp[i-2]) % MOD
        if i in a:
            dp[i] = 0
    print(dp[-1])


if __name__ == '__main__':
    solve()