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]
    if not holes[0]:
        dp.append(2)
    else:
        dp.append(1)

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

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

    print(dp[N-1])

main()

