import bisect





def typical_stairs(N: int, M: int, A: list)->int:

    MOD = 10**9 + 7



    A.sort()

    A.append(float('inf'))



    dp = [0] * (N+1)

    dp[0] = 1



    for i in range(N):

        if A[bisect.bisect_left(A, i+1)] == i+1:

            dp[i+1] = 0

        else:

            dp[i+1] = dp[i]

            if i > 0:

                dp[i+1] += dp[i-1]

                dp[i+1] %= MOD



    # print(dp)

    return dp[N]





if __name__ == "__main__":

    M = 0



    N, M = list(map(int, input().split()))

    A = [int(eval(input())) for _ in range(M)]



    ans = typical_stairs(N, M, A)

    print(ans)

def typical_stairs(N: int, M: int, A: list)->int:

    MOD = 10**9 + 7



    dp = [0] * (N+1)

    dp[0] = 1



    ai = 0

    for i in range(N):

        if ai < M and A[ai] == i+1:

            dp[i+1] = 0

            ai += 1

        else:

            dp[i+1] = dp[i]

            if i > 0:

                dp[i+1] += dp[i-1]

                dp[i+1] %= MOD



    # print(dp)

    return dp[N]





if __name__ == "__main__":

    M = 0



    N, M = list(map(int, input().split()))

    A = [int(eval(input())) for _ in range(M)]



    ans = typical_stairs(N, M, A)

    print(ans)

import bisect


def typical_stairs(N: int, M: int, A: list) -> int:
    MOD = 10**9 + 7
    A.sort()
    A.append(float("inf"))
    dp = [0] * (N + 1)
    dp[0] = 1
    for i in range(N):
        if A[bisect.bisect_left(A, i + 1)] == i + 1:
            dp[i + 1] = 0
        else:
            dp[i + 1] = dp[i]
            if i > 0:
                dp[i + 1] += dp[i - 1]
                dp[i + 1] %= MOD
    # print(dp)
    return dp[N]


if __name__ == "__main__":
    M = 0
    N, M = list(map(int, input().split()))
    A = [int(eval(input())) for _ in range(M)]
    ans = typical_stairs(N, M, A)
    print(ans)

def typical_stairs(N: int, M: int, A: list) -> int:
    MOD = 10**9 + 7
    dp = [0] * (N + 1)
    dp[0] = 1
    ai = 0
    for i in range(N):
        if ai < M and A[ai] == i + 1:
            dp[i + 1] = 0
            ai += 1
        else:
            dp[i + 1] = dp[i]
            if i > 0:
                dp[i + 1] += dp[i - 1]
                dp[i + 1] %= MOD
    # print(dp)
    return dp[N]


if __name__ == "__main__":
    M = 0
    N, M = list(map(int, input().split()))
    A = [int(eval(input())) for _ in range(M)]
    ans = typical_stairs(N, M, A)
    print(ans)

-import bisect - - -    A.sort() -    A.append(float("inf")) +    ai = 0 -        if A[bisect.bisect_left(A, i + 1)] == i + 1: +        if ai < M and A[ai] == i + 1: +            ai += 1