import math

from collections import deque



memo = deque([1, 2])

floor = 1

def search(x):

    global memo, floor

    while x > floor:

        memo.append(memo[-1] + memo[-2])

        floor += 1

    return memo[x-1]



CONST = 1000000007

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

lis = []

prev = -1

for _ in range(m):

    a = int(eval(input()))

    if prev + 1 == a:

        print((0))

        exit()

    lis.append(a-prev-2)

    prev = a

lis.append(n-prev-1)





ans = 1

for v in lis:

    if v == 0: continue

    ans = (ans * search(v)) % CONST

print(ans)

from collections import deque



CONST = 1000000007



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

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

lis.append(n+1)

nhole = lis.popleft()



memo = deque([0, 1])

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

    if i == nhole:

        memo.append(0)

        nhole = lis.popleft()

    else:

        memo.append((memo[-1] + memo[-2])%CONST)

print((memo[-1]))
import math
from collections import deque

memo = deque([1, 2])
floor = 1


def search(x):
    global memo, floor
    while x > floor:
        memo.append(memo[-1] + memo[-2])
        floor += 1
    return memo[x - 1]


CONST = 1000000007
n, m = list(map(int, input().split()))
lis = []
prev = -1
for _ in range(m):
    a = int(eval(input()))
    if prev + 1 == a:
        print((0))
        exit()
    lis.append(a - prev - 2)
    prev = a
lis.append(n - prev - 1)
ans = 1
for v in lis:
    if v == 0:
        continue
    ans = (ans * search(v)) % CONST
print(ans)

from collections import deque

CONST = 1000000007
n, m = list(map(int, input().split()))
lis = deque([int(eval(input())) for _ in range(m)])
lis.append(n + 1)
nhole = lis.popleft()
memo = deque([0, 1])
for i in range(1, n + 1):
    if i == nhole:
        memo.append(0)
        nhole = lis.popleft()
    else:
        memo.append((memo[-1] + memo[-2]) % CONST)
print((memo[-1]))

-import math - -memo = deque([1, 2]) -floor = 1 - - -def search(x): -    global memo, floor -    while x > floor: -        memo.append(memo[-1] + memo[-2]) -        floor += 1 -    return memo[x - 1] - -lis = [] -prev = -1 -for _ in range(m): -    a = int(eval(input())) -    if prev + 1 == a: -        print((0)) -        exit() -    lis.append(a - prev - 2) -    prev = a -lis.append(n - prev - 1) -ans = 1 -for v in lis: -    if v == 0: -        continue -    ans = (ans * search(v)) % CONST -print(ans) +lis = deque([int(eval(input())) for _ in range(m)]) +lis.append(n + 1) +nhole = lis.popleft() +memo = deque([0, 1]) +for i in range(1, n + 1): +    if i == nhole: +        memo.append(0) +        nhole = lis.popleft() +    else: +        memo.append((memo[-1] + memo[-2]) % CONST) +print((memo[-1]))