import sys

input = sys.stdin.readline



def inpl(): return list(map(int, input().split()))

N, M = inpl()

MOD = 10**9 + 7

A = [1]*(N+3)

for _ in range(M):

    a = int(eval(input()))

    A[a] -= 1



DP = [0]*(N+3)

DP[0] = 1

for i in range(N):

    DP[i+1] = ((DP[i+1] + DP[i])*A[i+1])%MOD

    DP[i+2] = ((DP[i+2] + DP[i])*A[i+2])%MOD

print((DP[N]))
import sys

input = sys.stdin.readline

from sys import setrecursionlimit

setrecursionlimit(10**9)



def inpl(): return list(map(int, input().split()))

N, M = inpl()

MOD = 10**9 + 7

A = [1]*(N+3)

A[N+2] = 0

A[N+1] = 0

for _ in range(M):

    a = int(eval(input()))

    A[a] = 0



DP = [0]*(N+3)

DP[0] = 1

for i in range(N):

    DP[i+1] = ((DP[i+1] + DP[i])*A[i+1])%MOD

    DP[i+2] = ((DP[i+2] + DP[i])*A[i+2])%MOD

print((DP[N]%MOD))
import sys

input = sys.stdin.readline


def inpl():
    return list(map(int, input().split()))


N, M = inpl()
MOD = 10**9 + 7
A = [1] * (N + 3)
for _ in range(M):
    a = int(eval(input()))
    A[a] -= 1
DP = [0] * (N + 3)
DP[0] = 1
for i in range(N):
    DP[i + 1] = ((DP[i + 1] + DP[i]) * A[i + 1]) % MOD
    DP[i + 2] = ((DP[i + 2] + DP[i]) * A[i + 2]) % MOD
print((DP[N]))

import sys

input = sys.stdin.readline
from sys import setrecursionlimit

setrecursionlimit(10**9)


def inpl():
    return list(map(int, input().split()))


N, M = inpl()
MOD = 10**9 + 7
A = [1] * (N + 3)
A[N + 2] = 0
A[N + 1] = 0
for _ in range(M):
    a = int(eval(input()))
    A[a] = 0
DP = [0] * (N + 3)
DP[0] = 1
for i in range(N):
    DP[i + 1] = ((DP[i + 1] + DP[i]) * A[i + 1]) % MOD
    DP[i + 2] = ((DP[i + 2] + DP[i]) * A[i + 2]) % MOD
print((DP[N] % MOD))

+from sys import setrecursionlimit + +setrecursionlimit(10**9) +A[N + 2] = 0 +A[N + 1] = 0 -    A[a] -= 1 +    A[a] = 0 -print((DP[N])) +print((DP[N] % MOD))