import sys





input = sys.stdin.readline



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

broken = set()

for i in range(m):

    a = int(eval(input()))

    broken.add(a)



pattern = [0]*(n+1)

pattern[0] = 1

if 1 in broken:

    pattern[1] = 0

else:

    pattern[1] = 1



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

    if i in broken:

        pattern[i] = 0

    else:

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



print((pattern[n] % (10**9+7)))

import sys

input = sys.stdin.readline



mod = 10**9+7

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

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



pattern = [0]*(n+1)

pattern[0] = 1

if 1 in broken:

    pattern[1] = 0

else:

    pattern[1] = 1



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

    if i in broken:

        continue

    else:

        pattern[i] = (pattern[i-1] + pattern[i-2]) % mod



print((pattern[n]))

import sys

input = sys.stdin.readline
n, m = list(map(int, input().split()))
broken = set()
for i in range(m):
    a = int(eval(input()))
    broken.add(a)
pattern = [0] * (n + 1)
pattern[0] = 1
if 1 in broken:
    pattern[1] = 0
else:
    pattern[1] = 1
for i in range(2, n + 1):
    if i in broken:
        pattern[i] = 0
    else:
        pattern[i] = pattern[i - 1] + pattern[i - 2]
print((pattern[n] % (10**9 + 7)))

import sys

input = sys.stdin.readline
mod = 10**9 + 7
n, m = list(map(int, input().split()))
broken = set(int(eval(input())) for i in range(m))
pattern = [0] * (n + 1)
pattern[0] = 1
if 1 in broken:
    pattern[1] = 0
else:
    pattern[1] = 1
for i in range(2, n + 1):
    if i in broken:
        continue
    else:
        pattern[i] = (pattern[i - 1] + pattern[i - 2]) % mod
print((pattern[n]))

+mod = 10**9 + 7 -broken = set() -for i in range(m): -    a = int(eval(input())) -    broken.add(a) +broken = set(int(eval(input())) for i in range(m)) -        pattern[i] = 0 +        continue -        pattern[i] = pattern[i - 1] + pattern[i - 2] -print((pattern[n] % (10**9 + 7))) +        pattern[i] = (pattern[i - 1] + pattern[i - 2]) % mod +print((pattern[n]))