import sys



sys.setrecursionlimit(1000000)



def steps(n):

    if memo[n] != -1:

        return memo[n]

    

    one = memo[n-1] if memo[n-1] != -1 else steps(n-1)    

    two = memo[n-2] if memo[n-2] != -1 else steps(n-2)



    memo[n] = one + two

    return memo[n]



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

broken = [int(eval(input())) for i in range(m)]

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

memo[0] = 1

memo[1] = 1

for b in broken:

    memo[b] = 0



print((steps(n) % (10**9+7)))
n, m = list(map(int, input().split()))

broken = [int(eval(input())) for i in range(m)]

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

dp[0] = 1

dp[1] = 1

for b in broken:

    dp[b] = 0

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

    if dp[i] == -1:

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

print((dp[n] % (10**9+7)))
import sys

sys.setrecursionlimit(1000000)


def steps(n):
    if memo[n] != -1:
        return memo[n]
    one = memo[n - 1] if memo[n - 1] != -1 else steps(n - 1)
    two = memo[n - 2] if memo[n - 2] != -1 else steps(n - 2)
    memo[n] = one + two
    return memo[n]


n, m = list(map(int, input().split()))
broken = [int(eval(input())) for i in range(m)]
memo = [-1 for i in range(n + 1)]
memo[0] = 1
memo[1] = 1
for b in broken:
    memo[b] = 0
print((steps(n) % (10**9 + 7)))

n, m = list(map(int, input().split()))
broken = [int(eval(input())) for i in range(m)]
dp = [-1 for i in range(n + 1)]
dp[0] = 1
dp[1] = 1
for b in broken:
    dp[b] = 0
for i in range(2, n + 1):
    if dp[i] == -1:
        dp[i] = dp[i - 1] + dp[i - 2]
print((dp[n] % (10**9 + 7)))

-import sys - -sys.setrecursionlimit(1000000) - - -def steps(n): -    if memo[n] != -1: -        return memo[n] -    one = memo[n - 1] if memo[n - 1] != -1 else steps(n - 1) -    two = memo[n - 2] if memo[n - 2] != -1 else steps(n - 2) -    memo[n] = one + two -    return memo[n] - - -memo = [-1 for i in range(n + 1)] -memo[0] = 1 -memo[1] = 1 +dp = [-1 for i in range(n + 1)] +dp[0] = 1 +dp[1] = 1 -    memo[b] = 0 -print((steps(n) % (10**9 + 7))) +    dp[b] = 0 +for i in range(2, n + 1): +    if dp[i] == -1: +        dp[i] = dp[i - 1] + dp[i - 2] +print((dp[n] % (10**9 + 7)))