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

MOD = 10 ** 9 + 7



is_broken = [False for _ in range(N + 1)]

for _ in range(M):

    a = int(eval(input()))

    is_broken[a] = True



dp = [0 for _ in range(N + 1)]

dp[0] = 1



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

    if is_broken[i]:

        continue

    if i == 1:

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

    else:

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



    dp[i] = dp[i] % MOD



print((dp[N]))

import sys



sys.setrecursionlimit(10 ** 6)

INF = float("inf")

MOD = 10 ** 9 + 7





def input():

    return sys.stdin.readline().strip()





def main():

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

    dp = [0] * (N + 1)

    safe = [True] * (N + 1)

    for _ in range(M):

        a = int(eval(input()))

        safe[a] = False



    dp[0] = 1

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

        if i == 1 and safe[i]:

            dp[i] = dp[i - 1]

        else:

            if safe[i]:

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

                dp[i] %= MOD



    print((dp[-1]))





if __name__ == "__main__":

    main()

N, M = list(map(int, input().split()))
MOD = 10**9 + 7
is_broken = [False for _ in range(N + 1)]
for _ in range(M):
    a = int(eval(input()))
    is_broken[a] = True
dp = [0 for _ in range(N + 1)]
dp[0] = 1
for i in range(1, N + 1):
    if is_broken[i]:
        continue
    if i == 1:
        dp[i] += dp[i - 1]
    else:
        dp[i] += dp[i - 1] + dp[i - 2]
    dp[i] = dp[i] % MOD
print((dp[N]))

import sys

sys.setrecursionlimit(10**6)
INF = float("inf")
MOD = 10**9 + 7


def input():
    return sys.stdin.readline().strip()


def main():
    N, M = list(map(int, input().split()))
    dp = [0] * (N + 1)
    safe = [True] * (N + 1)
    for _ in range(M):
        a = int(eval(input()))
        safe[a] = False
    dp[0] = 1
    for i in range(1, N + 1):
        if i == 1 and safe[i]:
            dp[i] = dp[i - 1]
        else:
            if safe[i]:
                dp[i] = dp[i - 1] + dp[i - 2]
                dp[i] %= MOD
    print((dp[-1]))


if __name__ == "__main__":
    main()

-N, M = list(map(int, input().split())) +import sys + +sys.setrecursionlimit(10**6) +INF = float("inf") -is_broken = [False for _ in range(N + 1)] -for _ in range(M): -    a = int(eval(input())) -    is_broken[a] = True -dp = [0 for _ in range(N + 1)] -dp[0] = 1 -for i in range(1, N + 1): -    if is_broken[i]: -        continue -    if i == 1: -        dp[i] += dp[i - 1] -    else: -        dp[i] += dp[i - 1] + dp[i - 2] -    dp[i] = dp[i] % MOD -print((dp[N])) + + +def input(): +    return sys.stdin.readline().strip() + + +def main(): +    N, M = list(map(int, input().split())) +    dp = [0] * (N + 1) +    safe = [True] * (N + 1) +    for _ in range(M): +        a = int(eval(input())) +        safe[a] = False +    dp[0] = 1 +    for i in range(1, N + 1): +        if i == 1 and safe[i]: +            dp[i] = dp[i - 1] +        else: +            if safe[i]: +                dp[i] = dp[i - 1] + dp[i - 2] +                dp[i] %= MOD +    print((dp[-1])) + + +if __name__ == "__main__": +    main()