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

mod = 10**9+7



#フィボナッチ数列

dp = [0 for i in range(n+2)]

dp[0] = 1

dp[1] = 1

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

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



#穴が無い場合

if m==0:

    print((dp[n]%mod))

    exit()



lst = []

for i in range(m):

    lst.append(int(eval(input())))

lst.sort()



#2連続穴がある場合

for i in range(len(lst)-1):

    if lst[i]+1 == lst[i+1]:

        print((0))

        exit()



lst2 = []

for i in range(len(lst)):

    if i==0:

        lst2.append(lst[0]-1)

    else:

        lst2.append(lst[i]-lst[i-1]-2)

lst2.append(n-lst[-1]-1)



ans = 1

for i in lst2:

    ans *= dp[i]

    ans %= mod



# print(lst)

# print(lst2)

print(ans)

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

mod = 10**9+7



lst = []

for i in range(m):

    lst.append(int(eval(input())))

lst.sort()



#フィボナッチ数列

dp = [-1 for i in range(n+2)]

dp[0] = 1

dp[1] = 1

for i in lst:

    dp[i] = 0

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

    if dp[i]<0:

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



# print(lst)

# print(lst2)

# print(dp)

print((dp[n]%mod))

n, m = list(map(int, input().split()))
mod = 10**9 + 7
# フィボナッチ数列
dp = [0 for i in range(n + 2)]
dp[0] = 1
dp[1] = 1
for i in range(2, n + 2):
    dp[i] = dp[i - 1] + dp[i - 2]
# 穴が無い場合
if m == 0:
    print((dp[n] % mod))
    exit()
lst = []
for i in range(m):
    lst.append(int(eval(input())))
lst.sort()
# 2連続穴がある場合
for i in range(len(lst) - 1):
    if lst[i] + 1 == lst[i + 1]:
        print((0))
        exit()
lst2 = []
for i in range(len(lst)):
    if i == 0:
        lst2.append(lst[0] - 1)
    else:
        lst2.append(lst[i] - lst[i - 1] - 2)
lst2.append(n - lst[-1] - 1)
ans = 1
for i in lst2:
    ans *= dp[i]
    ans %= mod
# print(lst)
# print(lst2)
print(ans)

n, m = list(map(int, input().split()))
mod = 10**9 + 7
lst = []
for i in range(m):
    lst.append(int(eval(input())))
lst.sort()
# フィボナッチ数列
dp = [-1 for i in range(n + 2)]
dp[0] = 1
dp[1] = 1
for i in lst:
    dp[i] = 0
for i in range(2, n + 2):
    if dp[i] < 0:
        dp[i] = dp[i - 1] + dp[i - 2]
# print(lst)
# print(lst2)
# print(dp)
print((dp[n] % mod))

-# フィボナッチ数列 -dp = [0 for i in range(n + 2)] -dp[0] = 1 -dp[1] = 1 -for i in range(2, n + 2): -    dp[i] = dp[i - 1] + dp[i - 2] -# 穴が無い場合 -if m == 0: -    print((dp[n] % mod)) -    exit() -# 2連続穴がある場合 -for i in range(len(lst) - 1): -    if lst[i] + 1 == lst[i + 1]: -        print((0)) -        exit() -lst2 = [] -for i in range(len(lst)): -    if i == 0: -        lst2.append(lst[0] - 1) -    else: -        lst2.append(lst[i] - lst[i - 1] - 2) -lst2.append(n - lst[-1] - 1) -ans = 1 -for i in lst2: -    ans *= dp[i] -    ans %= mod +# フィボナッチ数列 +dp = [-1 for i in range(n + 2)] +dp[0] = 1 +dp[1] = 1 +for i in lst: +    dp[i] = 0 +for i in range(2, n + 2): +    if dp[i] < 0: +        dp[i] = dp[i - 1] + dp[i - 2] -print(ans) +# print(dp) +print((dp[n] % mod))