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

a = [1]*N

for i in range(M):

    a[int(eval(input()))-1] = 0



mod = int(1e9+7)



dp = [0]*N



if N == 1:

    print((1))

    exit()



if a[0] and a[1]:

    dp[0] = 1

    dp[1] = 2

elif not a[0] and a[1]:

    dp[1] = 1



for i in range(2,N):

    if a[i]:

        dp[i] = dp[i-1] + dp[i-2]

    else:

        dp[i] = 0



print((dp[N-1]%mod))
N,M = list(map(int,input().split()))



step = [0]*N



for i in range(M):

    a = int(eval(input()))

    step[a-1] = 1



mod = int(1e9+7)



dp = [0]*N



if N == 1:

    if step[0]:

        print((0))

    else:

        print((1))

    exit()



if not step[0] and not step[1]:

    dp[0] = 1

    dp[1] = 2

elif step[0] and not step[1]:

    dp[0] = 0

    dp[1] = 1

elif not step[0] and step[1]:

    dp[0] = 1

    dp[1] = 0

else:

    print((0))

    exit()



for i in range(2,N):

    if step[i]:

        continue

    else:

        dp[i] = (dp[i-1] + dp[i-2])%mod

    

print((dp[-1]))

N, M = list(map(int, input().split()))
a = [1] * N
for i in range(M):
    a[int(eval(input())) - 1] = 0
mod = int(1e9 + 7)
dp = [0] * N
if N == 1:
    print((1))
    exit()
if a[0] and a[1]:
    dp[0] = 1
    dp[1] = 2
elif not a[0] and a[1]:
    dp[1] = 1
for i in range(2, N):
    if a[i]:
        dp[i] = dp[i - 1] + dp[i - 2]
    else:
        dp[i] = 0
print((dp[N - 1] % mod))

N, M = list(map(int, input().split()))
step = [0] * N
for i in range(M):
    a = int(eval(input()))
    step[a - 1] = 1
mod = int(1e9 + 7)
dp = [0] * N
if N == 1:
    if step[0]:
        print((0))
    else:
        print((1))
    exit()
if not step[0] and not step[1]:
    dp[0] = 1
    dp[1] = 2
elif step[0] and not step[1]:
    dp[0] = 0
    dp[1] = 1
elif not step[0] and step[1]:
    dp[0] = 1
    dp[1] = 0
else:
    print((0))
    exit()
for i in range(2, N):
    if step[i]:
        continue
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % mod
print((dp[-1]))

-a = [1] * N +step = [0] * N -    a[int(eval(input())) - 1] = 0 +    a = int(eval(input())) +    step[a - 1] = 1 -    print((1)) +    if step[0]: +        print((0)) +    else: +        print((1)) -if a[0] and a[1]: +if not step[0] and not step[1]: -elif not a[0] and a[1]: +elif step[0] and not step[1]: +    dp[0] = 0 +elif not step[0] and step[1]: +    dp[0] = 1 +    dp[1] = 0 +else: +    print((0)) +    exit() -    if a[i]: -        dp[i] = dp[i - 1] + dp[i - 2] +    if step[i]: +        continue -        dp[i] = 0 -print((dp[N - 1] % mod)) +        dp[i] = (dp[i - 1] + dp[i - 2]) % mod +print((dp[-1]))