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

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



memo = [0] * (N + 1)

memo[0] = 1

memo[1] = 0 if 1 in A else 1



if N == 1:

    print((memo[1]))

else:

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

        if i in A:

            continue

        memo[i] = (memo[i - 2] + memo[i - 1]) % 1000000007



    print((memo[N]))

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

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



memo = [0] * (N + 1)

memo[0] = 1

memo[1] = 0 if 1 in A else 1



if N == 1:

    print((memo[1]))

else:

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

        if i in A:

            continue

        memo[i] = (memo[i - 2] + memo[i - 1]) % 1000000007

    print((memo[N]))

N, M = list(map(int, input().split(" ")))
A = {int(eval(input())) for _ in range(M)}
memo = [0] * (N + 1)
memo[0] = 1
memo[1] = 0 if 1 in A else 1
if N == 1:
    print((memo[1]))
else:
    for i in range(2, N + 1):
        if i in A:
            continue
        memo[i] = (memo[i - 2] + memo[i - 1]) % 1000000007
    print((memo[N]))

N, M = list(map(int, input().split(" ")))
A = {int(input()) for _ in range(M)}
memo = [0] * (N + 1)
memo[0] = 1
memo[1] = 0 if 1 in A else 1
if N == 1:
    print((memo[1]))
else:
    for i in range(2, N + 1):
        if i in A:
            continue
        memo[i] = (memo[i - 2] + memo[i - 1]) % 1000000007
    print((memo[N]))

-A = {int(eval(input())) for _ in range(M)} +A = {int(input()) for _ in range(M)}