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

memo = [0]*(N+1)

memo[0] = 1

mod = 10**9+7



for _ in range(M):

    ai = int(eval(input()))

    memo[ai] = None



if memo[1] != None:

    memo[1] = 1



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

    tmp = 0

    if memo[i] == None:

        continue

    if memo[i-1] != None:

        tmp += memo[i-1]

    if memo[i-2] != None:

        tmp += memo[i-2]

    memo[i] = tmp



if memo[N] == None:

    print((0))

else:

    print((memo[N]%mod))

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

memo = [0]*(N+1)

memo[0] = 1

mod = 10**9+7



for _ in range(M):

    ai = int(eval(input()))

    memo[ai] = None



if memo[1] != None:

    memo[1] = 1



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

    tmp = 0

    if memo[i] == None:

        continue

    if memo[i-1] != None:

        tmp += memo[i-1]

    if memo[i-2] != None:

        tmp += memo[i-2]

    memo[i] = tmp % mod



if memo[N] == None:

    print((0))

else:

    print((memo[N]%mod))

N, M = list(map(int, input().split()))
memo = [0] * (N + 1)
memo[0] = 1
mod = 10**9 + 7
for _ in range(M):
    ai = int(eval(input()))
    memo[ai] = None
if memo[1] != None:
    memo[1] = 1
for i in range(2, N + 1):
    tmp = 0
    if memo[i] == None:
        continue
    if memo[i - 1] != None:
        tmp += memo[i - 1]
    if memo[i - 2] != None:
        tmp += memo[i - 2]
    memo[i] = tmp
if memo[N] == None:
    print((0))
else:
    print((memo[N] % mod))

N, M = list(map(int, input().split()))
memo = [0] * (N + 1)
memo[0] = 1
mod = 10**9 + 7
for _ in range(M):
    ai = int(eval(input()))
    memo[ai] = None
if memo[1] != None:
    memo[1] = 1
for i in range(2, N + 1):
    tmp = 0
    if memo[i] == None:
        continue
    if memo[i - 1] != None:
        tmp += memo[i - 1]
    if memo[i - 2] != None:
        tmp += memo[i - 2]
    memo[i] = tmp % mod
if memo[N] == None:
    print((0))
else:
    print((memo[N] % mod))

-    memo[i] = tmp +    memo[i] = tmp % mod