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

broken_lst = []

for _ in range(M):

    broken_lst.append(int(eval(input())))



counter_arr = [0]*(N+1)



counter_arr[0] = 1

next_broken = -1

if len(broken_lst) != 0:

    next_broken = broken_lst.pop(0)

last_broken = -1



for i in range(0, N-1):

    flug = 0

    if i+1 == next_broken:

        flug = 1

#        print("p0", i, counter_arr)

    elif i+1 == last_broken:

        pass

#        print("p1",i, counter_arr)

    else:

        counter_arr[i+1] += counter_arr[i]

        counter_arr[i+1] %= 10**9 + 7

#        print("p2",i,  counter_arr)



    if i + 2 == next_broken:

        flug = 1

#        print("p3",i, counter_arr)

    else:

        if i == 0 and len(broken_lst) != 0:

            if broken_lst[0] == 2 and next_broken == 1:

                continue

        counter_arr[i+2] += counter_arr[i]

        counter_arr[i+2] %= 10**9 + 7

#        print("p4",i, counter_arr)

    

    if flug == 1:

        last_broken = next_broken

        if len(broken_lst) != 0:

            next_broken = broken_lst.pop(0)



if last_broken != N - 1:

    counter_arr[-1] += counter_arr[-2]

counter_arr[-1] %= 10**9 + 7



print((counter_arr[-1]))

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

broken_lst = [1]*(N+1)

for _ in range(M):

    broken_lst[int(eval(input()))] = 0



counter_arr = [0]*(N+1)

counter_arr[0] = 1





for i in range(0, N-1):

    counter_arr[i+1] += counter_arr[i] * broken_lst[i+1]

    counter_arr[i+1] %= 10**9 + 7

    counter_arr[i+2] += counter_arr[i] * broken_lst[i+2]

    counter_arr[i+2] %= 10**9 + 7



counter_arr[-1] += counter_arr[-2] * broken_lst[-1]

counter_arr[-1] %= 10**9 + 7



print((counter_arr[-1]))

N, M = list(map(int, input().split()))
broken_lst = []
for _ in range(M):
    broken_lst.append(int(eval(input())))
counter_arr = [0] * (N + 1)
counter_arr[0] = 1
next_broken = -1
if len(broken_lst) != 0:
    next_broken = broken_lst.pop(0)
last_broken = -1
for i in range(0, N - 1):
    flug = 0
    if i + 1 == next_broken:
        flug = 1
    #        print("p0", i, counter_arr)
    elif i + 1 == last_broken:
        pass
    #        print("p1",i, counter_arr)
    else:
        counter_arr[i + 1] += counter_arr[i]
        counter_arr[i + 1] %= 10**9 + 7
    #        print("p2",i,  counter_arr)
    if i + 2 == next_broken:
        flug = 1
    #        print("p3",i, counter_arr)
    else:
        if i == 0 and len(broken_lst) != 0:
            if broken_lst[0] == 2 and next_broken == 1:
                continue
        counter_arr[i + 2] += counter_arr[i]
        counter_arr[i + 2] %= 10**9 + 7
    #        print("p4",i, counter_arr)
    if flug == 1:
        last_broken = next_broken
        if len(broken_lst) != 0:
            next_broken = broken_lst.pop(0)
if last_broken != N - 1:
    counter_arr[-1] += counter_arr[-2]
counter_arr[-1] %= 10**9 + 7
print((counter_arr[-1]))

N, M = list(map(int, input().split()))
broken_lst = [1] * (N + 1)
for _ in range(M):
    broken_lst[int(eval(input()))] = 0
counter_arr = [0] * (N + 1)
counter_arr[0] = 1
for i in range(0, N - 1):
    counter_arr[i + 1] += counter_arr[i] * broken_lst[i + 1]
    counter_arr[i + 1] %= 10**9 + 7
    counter_arr[i + 2] += counter_arr[i] * broken_lst[i + 2]
    counter_arr[i + 2] %= 10**9 + 7
counter_arr[-1] += counter_arr[-2] * broken_lst[-1]
counter_arr[-1] %= 10**9 + 7
print((counter_arr[-1]))

-broken_lst = [] +broken_lst = [1] * (N + 1) -    broken_lst.append(int(eval(input()))) +    broken_lst[int(eval(input()))] = 0 -next_broken = -1 -if len(broken_lst) != 0: -    next_broken = broken_lst.pop(0) -last_broken = -1 -    flug = 0 -    if i + 1 == next_broken: -        flug = 1 -    #        print("p0", i, counter_arr) -    elif i + 1 == last_broken: -        pass -    #        print("p1",i, counter_arr) -    else: -        counter_arr[i + 1] += counter_arr[i] -        counter_arr[i + 1] %= 10**9 + 7 -    #        print("p2",i,  counter_arr) -    if i + 2 == next_broken: -        flug = 1 -    #        print("p3",i, counter_arr) -    else: -        if i == 0 and len(broken_lst) != 0: -            if broken_lst[0] == 2 and next_broken == 1: -                continue -        counter_arr[i + 2] += counter_arr[i] -        counter_arr[i + 2] %= 10**9 + 7 -    #        print("p4",i, counter_arr) -    if flug == 1: -        last_broken = next_broken -        if len(broken_lst) != 0: -            next_broken = broken_lst.pop(0) -if last_broken != N - 1: -    counter_arr[-1] += counter_arr[-2] +    counter_arr[i + 1] += counter_arr[i] * broken_lst[i + 1] +    counter_arr[i + 1] %= 10**9 + 7 +    counter_arr[i + 2] += counter_arr[i] * broken_lst[i + 2] +    counter_arr[i + 2] %= 10**9 + 7 +counter_arr[-1] += counter_arr[-2] * broken_lst[-1]