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

a = [int(eval(input())) for i in range(m)]

a = set(a)

mod = 10**9+7

dp = [0] * (n+1)

dp[0] = 1

if not 1 in a:

    dp[1] = 1



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

    if i in a:

        continue

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



print((dp[n] % mod))

from collections import Counter,defaultdict,deque

from heapq import heappop,heappush,heapify

import sys,bisect,math,itertools,fractions,pprint

from decimal import Decimal

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))



n,m = inpl()

s = set([inp() for i in range(m)])

dp = [0] * (n+1)

dp[0] = 1

for i in range(n):

    if i+1 in s:

        dp[i+1] = 0

        continue

    if i == 0:

        dp[i+1] += dp[i]

    else:

        dp[i+1] += dp[i] + dp[i-1]

        dp[i+1] %= mod

print((dp[-1]))
n, m = list(map(int, input().split()))
a = [int(eval(input())) for i in range(m)]
a = set(a)
mod = 10**9 + 7
dp = [0] * (n + 1)
dp[0] = 1
if not 1 in a:
    dp[1] = 1
for i in range(2, n + 1):
    if i in a:
        continue
    dp[i] = dp[i - 1] + dp[i - 2]
print((dp[n] % mod))

from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
import sys, bisect, math, itertools, fractions, pprint
from decimal import Decimal

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


n, m = inpl()
s = set([inp() for i in range(m)])
dp = [0] * (n + 1)
dp[0] = 1
for i in range(n):
    if i + 1 in s:
        dp[i + 1] = 0
        continue
    if i == 0:
        dp[i + 1] += dp[i]
    else:
        dp[i + 1] += dp[i] + dp[i - 1]
        dp[i + 1] %= mod
print((dp[-1]))

-n, m = list(map(int, input().split())) -a = [int(eval(input())) for i in range(m)] -a = set(a) +from collections import Counter, defaultdict, deque +from heapq import heappop, heappush, heapify +import sys, bisect, math, itertools, fractions, pprint +from decimal import Decimal + +sys.setrecursionlimit(10**8) +INF = float("inf") + + +def inp(): +    return int(sys.stdin.readline()) + + +def inpl(): +    return list(map(int, sys.stdin.readline().split())) + + +n, m = inpl() +s = set([inp() for i in range(m)]) -if not 1 in a: -    dp[1] = 1 -for i in range(2, n + 1): -    if i in a: +for i in range(n): +    if i + 1 in s: +        dp[i + 1] = 0 -    dp[i] = dp[i - 1] + dp[i - 2] -print((dp[n] % mod)) +    if i == 0: +        dp[i + 1] += dp[i] +    else: +        dp[i + 1] += dp[i] + dp[i - 1] +        dp[i + 1] %= mod +print((dp[-1]))