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

a = set([int(eval(input())) for _ in range(M)])

p = 10**9+7



# F[N+1]: 0 ~ N 段目にたどり着く移動方法の場合の数

F = [None] * (N+1)

F[0] = 1

F[1] = 1

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

  if i-1 in a:

    tmp1 = 0

  else:

    tmp1 = F[i-1]

    

  if i-2 in a:

    tmp2 = 0

  else:

    tmp2 = F[i-2]

    

  F[i] = (tmp1 + tmp2) % p



# 基本的なDPの問題

# dp[v] = dp[v-1] + dp[v-2]だが、

# v-1, v-2は壊れていたら加算しない

print((F[N]))
N, M = list(map(int, input().split()))

a = [int(eval(input())) for _ in range(M)]

a = set(a)

m = 10**9+7

dp = [0] * (N+1)

dp[0] = 1

for i in range(N):

    if i+1 not in a:

        dp[i+1] = (dp[i+1] + dp[i]) % m

    if i < N-1 and i+2 not in a:

        dp[i+2] = (dp[i+2] + dp[i]) % m

print((dp[N]))
N, M = list(map(int, input().split()))
a = set([int(eval(input())) for _ in range(M)])
p = 10**9 + 7
# F[N+1]: 0 ~ N 段目にたどり着く移動方法の場合の数
F = [None] * (N + 1)
F[0] = 1
F[1] = 1
for i in range(2, N + 1):
    if i - 1 in a:
        tmp1 = 0
    else:
        tmp1 = F[i - 1]
    if i - 2 in a:
        tmp2 = 0
    else:
        tmp2 = F[i - 2]
    F[i] = (tmp1 + tmp2) % p
# 基本的なDPの問題
# dp[v] = dp[v-1] + dp[v-2]だが、
# v-1, v-2は壊れていたら加算しない
print((F[N]))

N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
a = set(a)
m = 10**9 + 7
dp = [0] * (N + 1)
dp[0] = 1
for i in range(N):
    if i + 1 not in a:
        dp[i + 1] = (dp[i + 1] + dp[i]) % m
    if i < N - 1 and i + 2 not in a:
        dp[i + 2] = (dp[i + 2] + dp[i]) % m
print((dp[N]))

-a = set([int(eval(input())) for _ in range(M)]) -p = 10**9 + 7 -# F[N+1]: 0 ~ N 段目にたどり着く移動方法の場合の数 -F = [None] * (N + 1) -F[0] = 1 -F[1] = 1 -for i in range(2, N + 1): -    if i - 1 in a: -        tmp1 = 0 -    else: -        tmp1 = F[i - 1] -    if i - 2 in a: -        tmp2 = 0 -    else: -        tmp2 = F[i - 2] -    F[i] = (tmp1 + tmp2) % p -# 基本的なDPの問題 -# dp[v] = dp[v-1] + dp[v-2]だが、 -# v-1, v-2は壊れていたら加算しない -print((F[N])) +a = [int(eval(input())) for _ in range(M)] +a = set(a) +m = 10**9 + 7 +dp = [0] * (N + 1) +dp[0] = 1 +for i in range(N): +    if i + 1 not in a: +        dp[i + 1] = (dp[i + 1] + dp[i]) % m +    if i < N - 1 and i + 2 not in a: +        dp[i + 2] = (dp[i + 2] + dp[i]) % m +print((dp[N]))