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

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

dp = [0] * (N + 1)

dp[0] = 1

if 1 not in a:

    dp[1] = 1



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

    for k in [-2, -1]:

        if i + k not in a:

            dp[i] += dp[i+k]



print((dp[N] % 1000000007))

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

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

dp = [0] * (N + 1)

dp[0] = 1

if 1 not in a:

    dp[1] = 1



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

    for k in [-2, -1]:

        if i + k not in a:

            dp[i] += dp[i+k]

            dp[i] %= 1000000007



print((dp[N]))

N, M = list(map(int, input().split()))
a = set(int(eval(input())) for _ in range(M))
dp = [0] * (N + 1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1
for i in range(2, N + 1):
    for k in [-2, -1]:
        if i + k not in a:
            dp[i] += dp[i + k]
print((dp[N] % 1000000007))

N, M = list(map(int, input().split()))
a = set(int(eval(input())) for _ in range(M))
dp = [0] * (N + 1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1
for i in range(2, N + 1):
    for k in [-2, -1]:
        if i + k not in a:
            dp[i] += dp[i + k]
            dp[i] %= 1000000007
print((dp[N]))

-print((dp[N] % 1000000007)) +            dp[i] %= 1000000007 +print((dp[N]))