def c_typical_stairs(N, M, A, MOD=10**9 + 7):

    a = set(A)

    stairs = [0] * (N + 100)

    stairs[0] = 1

    for i in range(N):

        if i + 1 <= N and (i + 1) not in a:

            stairs[i + 1] += stairs[i]

        if i + 2 <= N and (i + 2) not in a:

            stairs[i + 2] += stairs[i]

    return stairs[N] % MOD



N, M = [int(i) for i in input().split()]

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

print((c_typical_stairs(N, M, A)))
def c_typical_stairs(N, M, A, MOD=(10**9 + 7)):

    a = set(A)

    stairs = [0] * (N + 1)

    stairs[0] = 1

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

        if i in a:

            continue

        if i - 1 >= 0:

            stairs[i] += stairs[i - 1]

            stairs[i] %= MOD

        if i - 2 >= 0:

            stairs[i] += stairs[i - 2]

            stairs[i] %= MOD

    return stairs[N] % MOD



N, M = [int(i) for i in input().split()]

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

print((c_typical_stairs(N, M, A)))
def c_typical_stairs(N, M, A, MOD=10**9 + 7):
    a = set(A)
    stairs = [0] * (N + 100)
    stairs[0] = 1
    for i in range(N):
        if i + 1 <= N and (i + 1) not in a:
            stairs[i + 1] += stairs[i]
        if i + 2 <= N and (i + 2) not in a:
            stairs[i + 2] += stairs[i]
    return stairs[N] % MOD


N, M = [int(i) for i in input().split()]
A = [int(eval(input())) for _ in range(M)]
print((c_typical_stairs(N, M, A)))

def c_typical_stairs(N, M, A, MOD=(10**9 + 7)):
    a = set(A)
    stairs = [0] * (N + 1)
    stairs[0] = 1
    for i in range(1, N + 1):
        if i in a:
            continue
        if i - 1 >= 0:
            stairs[i] += stairs[i - 1]
            stairs[i] %= MOD
        if i - 2 >= 0:
            stairs[i] += stairs[i - 2]
            stairs[i] %= MOD
    return stairs[N] % MOD


N, M = [int(i) for i in input().split()]
A = [int(eval(input())) for _ in range(M)]
print((c_typical_stairs(N, M, A)))

-def c_typical_stairs(N, M, A, MOD=10**9 + 7): +def c_typical_stairs(N, M, A, MOD=(10**9 + 7)): -    stairs = [0] * (N + 100) +    stairs = [0] * (N + 1) -    for i in range(N): -        if i + 1 <= N and (i + 1) not in a: -            stairs[i + 1] += stairs[i] -        if i + 2 <= N and (i + 2) not in a: -            stairs[i + 2] += stairs[i] +    for i in range(1, N + 1): +        if i in a: +            continue +        if i - 1 >= 0: +            stairs[i] += stairs[i - 1] +            stairs[i] %= MOD +        if i - 2 >= 0: +            stairs[i] += stairs[i - 2] +            stairs[i] %= MOD