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



A = [True for i in range(N + 1)]



dp = [0 for i in range(N + 2)]



for i in range(M):

    a = int(eval(input()))

    A[a] = False



dp[0] = 1

for i in range(N):

    if A[i] == 0:

        continue

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

    dp[i + 1] %= 1000000007

    dp[i + 2] += dp[i]

    dp[i + 2] %= 1000000007



print((dp[N]))

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



A = [True for i in range(N + 2)]



dp = [0 for i in range(N + 3)]



for i in range(M):

    a = int(eval(input()))

    A[a] = False



dp[0] = 1

for i in range(N):

    if A[i] == False:

        continue

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

    dp[i + 1] %= 1000000007

    dp[i + 2] += dp[i]

    dp[i + 2] %= 1000000007



print((dp[N]))

N, M = list(map(int, input().split()))
A = [True for i in range(N + 1)]
dp = [0 for i in range(N + 2)]
for i in range(M):
    a = int(eval(input()))
    A[a] = False
dp[0] = 1
for i in range(N):
    if A[i] == 0:
        continue
    dp[i + 1] += dp[i]
    dp[i + 1] %= 1000000007
    dp[i + 2] += dp[i]
    dp[i + 2] %= 1000000007
print((dp[N]))

N, M = list(map(int, input().split()))
A = [True for i in range(N + 2)]
dp = [0 for i in range(N + 3)]
for i in range(M):
    a = int(eval(input()))
    A[a] = False
dp[0] = 1
for i in range(N):
    if A[i] == False:
        continue
    dp[i + 1] += dp[i]
    dp[i + 1] %= 1000000007
    dp[i + 2] += dp[i]
    dp[i + 2] %= 1000000007
print((dp[N]))

-A = [True for i in range(N + 1)] -dp = [0 for i in range(N + 2)] +A = [True for i in range(N + 2)] +dp = [0 for i in range(N + 3)] -    if A[i] == 0: +    if A[i] == False: