# python template for atcoder1

import sys

sys.setrecursionlimit(10**9)

input = sys.stdin.readline

MOD = 10**9+7

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

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



dp = [0]*(N+1)

dp[0] = 1

for i in range(N+1):

    for j in [1, 2]:

        if i+j <= N and not i+j in broken:

            dp[i+j] += dp[i]

            dp[i+j] %= MOD

print((dp[-1]))

# python template for atcoder1

import sys

sys.setrecursionlimit(10**9)

input = sys.stdin.readline

mod = 10**9+7

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

broken = {int(eval(input())) for _ in range(m)}



dp = [0]*(n+1)

dp[0] = 1

for i in range(n+1):

    for j in (1, 2):

        nex = i+j

        if nex <= n and not nex in broken:

            dp[nex] += dp[i]

            dp[nex] %= mod

print((dp[-1]))

# python template for atcoder1
import sys

sys.setrecursionlimit(10**9)
input = sys.stdin.readline
MOD = 10**9 + 7
N, M = list(map(int, input().split()))
broken = {int(eval(input())) for _ in range(M)}
dp = [0] * (N + 1)
dp[0] = 1
for i in range(N + 1):
    for j in [1, 2]:
        if i + j <= N and not i + j in broken:
            dp[i + j] += dp[i]
            dp[i + j] %= MOD
print((dp[-1]))

# python template for atcoder1
import sys

sys.setrecursionlimit(10**9)
input = sys.stdin.readline
mod = 10**9 + 7
n, m = list(map(int, input().split()))
broken = {int(eval(input())) for _ in range(m)}
dp = [0] * (n + 1)
dp[0] = 1
for i in range(n + 1):
    for j in (1, 2):
        nex = i + j
        if nex <= n and not nex in broken:
            dp[nex] += dp[i]
            dp[nex] %= mod
print((dp[-1]))

-MOD = 10**9 + 7 -N, M = list(map(int, input().split())) -broken = {int(eval(input())) for _ in range(M)} -dp = [0] * (N + 1) +mod = 10**9 + 7 +n, m = list(map(int, input().split())) +broken = {int(eval(input())) for _ in range(m)} +dp = [0] * (n + 1) -for i in range(N + 1): -    for j in [1, 2]: -        if i + j <= N and not i + j in broken: -            dp[i + j] += dp[i] -            dp[i + j] %= MOD +for i in range(n + 1): +    for j in (1, 2): +        nex = i + j +        if nex <= n and not nex in broken: +            dp[nex] += dp[i] +            dp[nex] %= mod