import sys

input = sys.stdin.readline

N, M = [int(x) for x in input().strip().split()]

A = set([int(eval(input())) for _ in range(M)])

s = [0 for _ in range(N + 1)]

s[0] = 1

if 1 not in A:

  s[1] = 1



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

  if n in A:

    continue

  else:

    s[n] = s[n-1] + s[n-2]

print((s[-1] % (10 ** 9 + 7)))

import sys

input = sys.stdin.readline

N, M = [int(x) for x in input().strip().split()]

A = set([int(eval(input())) for _ in range(M)])

s = 1

s_ = 0

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

  if n in A:

    s, s_ = 0, s

    continue

  s, s_ = s + s_, s

print((s % (10 ** 9 + 7)))

import sys

input = sys.stdin.readline
N, M = [int(x) for x in input().strip().split()]
A = set([int(eval(input())) for _ in range(M)])
s = [0 for _ in range(N + 1)]
s[0] = 1
if 1 not in A:
    s[1] = 1
for n in range(2, N + 1):
    if n in A:
        continue
    else:
        s[n] = s[n - 1] + s[n - 2]
print((s[-1] % (10**9 + 7)))

import sys

input = sys.stdin.readline
N, M = [int(x) for x in input().strip().split()]
A = set([int(eval(input())) for _ in range(M)])
s = 1
s_ = 0
for n in range(1, N + 1):
    if n in A:
        s, s_ = 0, s
        continue
    s, s_ = s + s_, s
print((s % (10**9 + 7)))

-s = [0 for _ in range(N + 1)] -s[0] = 1 -if 1 not in A: -    s[1] = 1 -for n in range(2, N + 1): +s = 1 +s_ = 0 +for n in range(1, N + 1): +        s, s_ = 0, s -    else: -        s[n] = s[n - 1] + s[n - 2] -print((s[-1] % (10**9 + 7))) +    s, s_ = s + s_, s +print((s % (10**9 + 7)))