def main():
    N, M = list(map(int, input().split(' ')))
    hole_indice = [int(input()) - 1 for i in range(M)]
    holes = [True if i in hole_indice else False for i in range(N)]

    if holes[0] and holes[1]:
        print(0)
        return

    dp = [-1 for i in range(N)]
    dp[0] = 1
    if not holes[0]:
        dp[1] = 2
    else:
        dp[1] = 1

    for i in range(2, N):
        if holes[i]:
            if holes[i-1]:
                print(0)
                return
            else:
                dp[i] = dp[i-1]

        else:
            if not holes[i-1] and not holes[i-2]:
                dp[i] = (dp[i-1] + dp[i-2]) % 1000000007
            else:
                dp[i] = dp[i-1]

    print(dp[N-1])

main()

