from collections import deque

 

N, M = list(map(int, input().split()))

 

a = []

aindex = 0

for _ in range(M):

    a.append(int(eval(input())))

 

before1 = 1

before2 = 0

ai=0

if len(a)>0:

    ai = a[aindex]

 

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

    if i == ai:

        before2 = before1

        before1 = 0

        if aindex < len(a)-1:

            aindex += 1

            ai = a[aindex]

    else:

        current = divmod(before1 + before2, 10**9+7)[1]

        before2 = before1

        before1 = current

 

 

print(before1)
from collections import deque



N, M = list(map(int, input().split()))

a = deque([int(eval(input())) for _ in range(M)])



before1 = 1

before2 = 0

ai = a.popleft() if len(a) else 0



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

    if i == ai:

        before2 = before1

        before1 = 0

        ai = a.popleft() if len(a) else ai

    else:

        current = divmod(before1 + before2, 10**9+7)[1]

        before2 = before1

        before1 = current



print(before1)

from collections import deque

N, M = list(map(int, input().split()))
a = []
aindex = 0
for _ in range(M):
    a.append(int(eval(input())))
before1 = 1
before2 = 0
ai = 0
if len(a) > 0:
    ai = a[aindex]
for i in range(1, N + 1):
    if i == ai:
        before2 = before1
        before1 = 0
        if aindex < len(a) - 1:
            aindex += 1
            ai = a[aindex]
    else:
        current = divmod(before1 + before2, 10**9 + 7)[1]
        before2 = before1
        before1 = current
print(before1)

from collections import deque

N, M = list(map(int, input().split()))
a = deque([int(eval(input())) for _ in range(M)])
before1 = 1
before2 = 0
ai = a.popleft() if len(a) else 0
for i in range(1, N + 1):
    if i == ai:
        before2 = before1
        before1 = 0
        ai = a.popleft() if len(a) else ai
    else:
        current = divmod(before1 + before2, 10**9 + 7)[1]
        before2 = before1
        before1 = current
print(before1)

-a = [] -aindex = 0 -for _ in range(M): -    a.append(int(eval(input()))) +a = deque([int(eval(input())) for _ in range(M)]) -ai = 0 -if len(a) > 0: -    ai = a[aindex] +ai = a.popleft() if len(a) else 0 -        if aindex < len(a) - 1: -            aindex += 1 -            ai = a[aindex] +        ai = a.popleft() if len(a) else ai