#C

n, m = list(map(int, input().split()))

a = [1] * (n + 1)

mod=1e9+7

for i in range(m):

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

b = [1] * (n + 1)

if a[1] == 0:

    b[1] = 0

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

    b[i] = int(a[i] * (b[i - 2] + b[i - 1]) % mod)

print((b[n]))
#C

n, m = list(map(int, input().split()))

a = [1] * (n + 1)#進めるかどうか

b = [1] * (n + 1)#移動方法

#進めない:0 進める:1

for i in range(m):a[int(eval(input()))] = 0

mod = 1e9+7

# print(a)

if a[1] == 0:b[1] = 0

for i in range(2, n+1):b[i] = (b[i - 1] + b[i - 2]) * a[i] % mod

    #b[i]=(b[2段前]+b[1段前])*a[i] 進めるかどうか(1,0)

print((int(b[n])))

# C
n, m = list(map(int, input().split()))
a = [1] * (n + 1)
mod = 1e9 + 7
for i in range(m):
    a[int(eval(input()))] = 0
b = [1] * (n + 1)
if a[1] == 0:
    b[1] = 0
for i in range(2, n + 1):
    b[i] = int(a[i] * (b[i - 2] + b[i - 1]) % mod)
print((b[n]))

# C
n, m = list(map(int, input().split()))
a = [1] * (n + 1)  # 進めるかどうか
b = [1] * (n + 1)  # 移動方法
# 進めない:0 進める:1
for i in range(m):
    a[int(eval(input()))] = 0
mod = 1e9 + 7
# print(a)
if a[1] == 0:
    b[1] = 0
for i in range(2, n + 1):
    b[i] = (b[i - 1] + b[i - 2]) * a[i] % mod
# b[i]=(b[2段前]+b[1段前])*a[i] 進めるかどうか(1,0)
print((int(b[n])))

-a = [1] * (n + 1) -mod = 1e9 + 7 +a = [1] * (n + 1)  # 進めるかどうか +b = [1] * (n + 1)  # 移動方法 +# 進めない:0 進める:1 -b = [1] * (n + 1) +mod = 1e9 + 7 +# print(a) -    b[i] = int(a[i] * (b[i - 2] + b[i - 1]) % mod) -print((b[n])) +    b[i] = (b[i - 1] + b[i - 2]) * a[i] % mod +# b[i]=(b[2段前]+b[1段前])*a[i] 進めるかどうか(1,0) +print((int(b[n])))