import sys

sys.setrecursionlimit(500000)



def f(i):

    if dp[i] != -1 and dp[i] != 0: return dp[i]

    if dp[i] == -1: return 0



    if i == -1:

        return f(i - 1)

    elif i > 1:

        dp[i] = f(i - 1) + f(i - 2)

    else:

        dp[i] = f(i - 1)

    return dp[i]



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

dp = [0]*(n+1)

ary = [int(eval(input())) for _ in range(m)]

dp[0] = 1

for i in ary:

    dp[i] = -1

    if dp[i-1] == -1 and dp[i] == -1:print((0));exit()

print((f(n)%(10**9+7)))

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

dp = [0]*(n+1)

for i in range(m):

    x = int(eval(input()))

    dp[x] = -1

dp[0] = 1

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

    if dp[i] == -1:continue

    elif dp[i-1] == -1:dp[i] = dp[i-2]

    elif dp[i-2] == -1:dp[i] = dp[i-1]

    elif i > 1:

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

    else:dp[i] = dp[i-1]

print((dp[n]%(10**9+7) if dp[n] != -1 else 0))
import sys

sys.setrecursionlimit(500000)


def f(i):
    if dp[i] != -1 and dp[i] != 0:
        return dp[i]
    if dp[i] == -1:
        return 0
    if i == -1:
        return f(i - 1)
    elif i > 1:
        dp[i] = f(i - 1) + f(i - 2)
    else:
        dp[i] = f(i - 1)
    return dp[i]


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

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

-import sys - -sys.setrecursionlimit(500000) - - -def f(i): -    if dp[i] != -1 and dp[i] != 0: -        return dp[i] -    if dp[i] == -1: -        return 0 -    if i == -1: -        return f(i - 1) -    elif i > 1: -        dp[i] = f(i - 1) + f(i - 2) -    else: -        dp[i] = f(i - 1) -    return dp[i] - - -ary = [int(eval(input())) for _ in range(m)] +for i in range(m): +    x = int(eval(input())) +    dp[x] = -1 -for i in ary: -    dp[i] = -1 -    if dp[i - 1] == -1 and dp[i] == -1: -        print((0)) -        exit() -print((f(n) % (10**9 + 7))) +for i in range(1, n + 1): +    if dp[i] == -1: +        continue +    elif dp[i - 1] == -1: +        dp[i] = dp[i - 2] +    elif dp[i - 2] == -1: +        dp[i] = dp[i - 1] +    elif i > 1: +        dp[i] = dp[i - 2] + dp[i - 1] +    else: +        dp[i] = dp[i - 1] +print((dp[n] % (10**9 + 7) if dp[n] != -1 else 0))