if __name__ == "__main__":

    mod = 10 ** 9 + 7

    n, m = list(map(int, input().split()))

    a = list()

    for i in range(m):

        a.append(int(eval(input())))



    dp = [0] * (n + 1)



    for aa in a:

        dp[aa] = -1



    if dp[1] != -1:

        dp[1] = 1

    else:

        dp[1] = 0



    if n > 1:

        if dp[2] != -1:

            dp[2] = 1 + dp[1]

        else:

            dp[2] = 0



        for i in range(3, n+1):

            if dp[i] != -1:

                dp[i] = (dp[i-2] + dp[i-1]) % mod

            else:

                dp[i] = 0



    print((dp[n]))

def solve(N, a):

    mod = 10**9 + 7

    dp = [0] * (N+1)

    step = [0] * (N+1)

    for aa in a:

        step[aa] = 1



    dp[0] = 1

    if step[1] == 0:

        dp[1] = 1



    for i in range(2, N+1):

        if step[i] == 0:

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

            dp[i] %= mod



    return dp[N]





if __name__ == "__main__":

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

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



    print((solve(N, a)))

if __name__ == "__main__":
    mod = 10**9 + 7
    n, m = list(map(int, input().split()))
    a = list()
    for i in range(m):
        a.append(int(eval(input())))
    dp = [0] * (n + 1)
    for aa in a:
        dp[aa] = -1
    if dp[1] != -1:
        dp[1] = 1
    else:
        dp[1] = 0
    if n > 1:
        if dp[2] != -1:
            dp[2] = 1 + dp[1]
        else:
            dp[2] = 0
        for i in range(3, n + 1):
            if dp[i] != -1:
                dp[i] = (dp[i - 2] + dp[i - 1]) % mod
            else:
                dp[i] = 0
    print((dp[n]))

def solve(N, a):
    mod = 10**9 + 7
    dp = [0] * (N + 1)
    step = [0] * (N + 1)
    for aa in a:
        step[aa] = 1
    dp[0] = 1
    if step[1] == 0:
        dp[1] = 1
    for i in range(2, N + 1):
        if step[i] == 0:
            dp[i] = dp[i - 1] + dp[i - 2]
            dp[i] %= mod
    return dp[N]


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

+def solve(N, a): +    mod = 10**9 + 7 +    dp = [0] * (N + 1) +    step = [0] * (N + 1) +    for aa in a: +        step[aa] = 1 +    dp[0] = 1 +    if step[1] == 0: +        dp[1] = 1 +    for i in range(2, N + 1): +        if step[i] == 0: +            dp[i] = dp[i - 1] + dp[i - 2] +            dp[i] %= mod +    return dp[N] + + -    mod = 10**9 + 7 -    n, m = list(map(int, input().split())) -    a = list() -    for i in range(m): -        a.append(int(eval(input()))) -    dp = [0] * (n + 1) -    for aa in a: -        dp[aa] = -1 -    if dp[1] != -1: -        dp[1] = 1 -    else: -        dp[1] = 0 -    if n > 1: -        if dp[2] != -1: -            dp[2] = 1 + dp[1] -        else: -            dp[2] = 0 -        for i in range(3, n + 1): -            if dp[i] != -1: -                dp[i] = (dp[i - 2] + dp[i - 1]) % mod -            else: -                dp[i] = 0 -    print((dp[n])) +    N, M = list(map(int, input().split())) +    a = [int(eval(input())) for _ in range(M)] +    print((solve(N, a)))