def main(N,M,a):

    dp = [-1]*N

    dp[0] = 1

    if N != 1:

        dp[1] = 2

    for i in a:

        if i == 1:

            dp[0] = 0

            dp[1] = 1

        else:

            dp[i-1] = 0

    for i in range(2,N):

        if dp[i] != 0:

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

    return dp[-1]

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

a = list(int(eval(input())) for i in range(M))



print((main(N,M,a) % 1000000007))
import sys

def I(): return int(sys.stdin.readline().rstrip())

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

N,M = LI()

a = set([I() for _ in range(M)])

if N==1:

    print((1))

    exit()

dp = [0]*(N+1) #1_indexed

dp[1] = 0 if 1 in a else 1

dp[2] = 0 if 2 in a else (1+dp[1])

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

    if i in a:

        dp[i] = 0

        continue

    dp[i] = (dp[i-2]+dp[i-1])%1000000007

print((dp[-1]))

def main(N, M, a):
    dp = [-1] * N
    dp[0] = 1
    if N != 1:
        dp[1] = 2
    for i in a:
        if i == 1:
            dp[0] = 0
            dp[1] = 1
        else:
            dp[i - 1] = 0
    for i in range(2, N):
        if dp[i] != 0:
            dp[i] = dp[i - 1] + dp[i - 2]
    return dp[-1]


N, M = list(map(int, input().split()))
a = list(int(eval(input())) for i in range(M))
print((main(N, M, a) % 1000000007))

import sys


def I():
    return int(sys.stdin.readline().rstrip())


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


N, M = LI()
a = set([I() for _ in range(M)])
if N == 1:
    print((1))
    exit()
dp = [0] * (N + 1)  # 1_indexed
dp[1] = 0 if 1 in a else 1
dp[2] = 0 if 2 in a else (1 + dp[1])
for i in range(3, N + 1):
    if i in a:
        dp[i] = 0
        continue
    dp[i] = (dp[i - 2] + dp[i - 1]) % 1000000007
print((dp[-1]))

-def main(N, M, a): -    dp = [-1] * N -    dp[0] = 1 -    if N != 1: -        dp[1] = 2 -    for i in a: -        if i == 1: -            dp[0] = 0 -            dp[1] = 1 -        else: -            dp[i - 1] = 0 -    for i in range(2, N): -        if dp[i] != 0: -            dp[i] = dp[i - 1] + dp[i - 2] -    return dp[-1] +import sys -N, M = list(map(int, input().split())) -a = list(int(eval(input())) for i in range(M)) -print((main(N, M, a) % 1000000007)) +def I(): +    return int(sys.stdin.readline().rstrip()) + + +def LI(): +    return list(map(int, sys.stdin.readline().rstrip().split())) + + +N, M = LI() +a = set([I() for _ in range(M)]) +if N == 1: +    print((1)) +    exit() +dp = [0] * (N + 1)  # 1_indexed +dp[1] = 0 if 1 in a else 1 +dp[2] = 0 if 2 in a else (1 + dp[1]) +for i in range(3, N + 1): +    if i in a: +        dp[i] = 0 +        continue +    dp[i] = (dp[i - 2] + dp[i - 1]) % 1000000007 +print((dp[-1]))