mod = 10**9+7

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

l = [0]*n

for _ in range(m):

  l[int(eval(input()))-1] = 1



s = 0

t = 1



for i in range(n):

  if l[i] > 0:

    t, s = 0, t

  else:

    t, s = (s+t)%mod, t



print(t)
import sys

input = sys.stdin.readline



mod = 10**9+7

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

l = [0]*n

for _ in range(m):

  l[int(eval(input()))-1] = 1



t, s = 1, 0



for i in range(n):

  if l[i]:

    t, s = 0, t

  else:

    t, s = (s+t)%mod, t



print(t)
mod = 10**9 + 7
n, m = list(map(int, input().split()))
l = [0] * n
for _ in range(m):
    l[int(eval(input())) - 1] = 1
s = 0
t = 1
for i in range(n):
    if l[i] > 0:
        t, s = 0, t
    else:
        t, s = (s + t) % mod, t
print(t)

import sys

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

+import sys + +input = sys.stdin.readline -s = 0 -t = 1 +t, s = 1, 0 -    if l[i] > 0: +    if l[i]: