import numpy as np





def main(n, m, a):

    dp = np.zeros(n + 1, dtype=int)

    dp[0] = 1

    dp[1] = 1 if 1 not in a else 0



    for i in range(2, len(dp)):

        dp[i] = dp[i - 1] + dp[i - 2] if i not in a else 0

        dp[i] %= 1000000007



    return dp[-1]





if __name__ == '__main__':

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

    A = set()

    for _ in range(M):

        A.add(int(eval(input())))



    print((main(N, M, A)))

import math



MOD = int(math.pow(10, 9)) + 7

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

broken_steps = {int(eval(input())) for _ in range(M)}



dp = [0] * (N + 1)



dp[0] = 1

if 1 not in broken_steps:

    dp[1] = 1



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

    if step not in broken_steps:

        dp[step] = (dp[step - 1] + dp[step - 2]) % MOD



print((dp[N]))

import numpy as np


def main(n, m, a):
    dp = np.zeros(n + 1, dtype=int)
    dp[0] = 1
    dp[1] = 1 if 1 not in a else 0
    for i in range(2, len(dp)):
        dp[i] = dp[i - 1] + dp[i - 2] if i not in a else 0
        dp[i] %= 1000000007
    return dp[-1]


if __name__ == "__main__":
    N, M = list(map(int, input().split()))
    A = set()
    for _ in range(M):
        A.add(int(eval(input())))
    print((main(N, M, A)))

import math

MOD = int(math.pow(10, 9)) + 7
N, M = list(map(int, input().split(" ")))
broken_steps = {int(eval(input())) for _ in range(M)}
dp = [0] * (N + 1)
dp[0] = 1
if 1 not in broken_steps:
    dp[1] = 1
for step in range(2, N + 1):
    if step not in broken_steps:
        dp[step] = (dp[step - 1] + dp[step - 2]) % MOD
print((dp[N]))

-import numpy as np +import math - -def main(n, m, a): -    dp = np.zeros(n + 1, dtype=int) -    dp[0] = 1 -    dp[1] = 1 if 1 not in a else 0 -    for i in range(2, len(dp)): -        dp[i] = dp[i - 1] + dp[i - 2] if i not in a else 0 -        dp[i] %= 1000000007 -    return dp[-1] - - -if __name__ == "__main__": -    N, M = list(map(int, input().split())) -    A = set() -    for _ in range(M): -        A.add(int(eval(input()))) -    print((main(N, M, A))) +MOD = int(math.pow(10, 9)) + 7 +N, M = list(map(int, input().split(" "))) +broken_steps = {int(eval(input())) for _ in range(M)} +dp = [0] * (N + 1) +dp[0] = 1 +if 1 not in broken_steps: +    dp[1] = 1 +for step in range(2, N + 1): +    if step not in broken_steps: +        dp[step] = (dp[step - 1] + dp[step - 2]) % MOD +print((dp[N]))