from functools import lru_cache

import sys

sys.setrecursionlimit(30000)



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

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



MOD = pow(10, 9) + 7



isOk = True

for i in range(M-1):

    if a[i] + 1 == a[i+1]:

        isOk = False

    

funcb = [-1] * 100001

def func(n):

    if n <= 0:

        return 1

    cnt = funcb[n]

    if cnt > 0:

        return cnt

    cnt = 0

    if n >= 2:

        cnt += func(n-2)

    if n >= 1:

        cnt += func(n-1)

    funcb[n] = cnt % MOD

    return funcb[n]



func(30000)

func(50000)

func(80000)

func(100000)



if not isOk:

    print((0))

else:

    ans = 1

    s = 0

    for i in range(M+1):

        if i >= M:

            e = N

        else:

            e = a[i] - 1



        ans = ans * func(e-s) % MOD



        if i >= M:

            break



        s = a[i] + 1



    print(ans)

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

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



MOD = pow(10, 9) + 7



MAP = [0] * (N + 1)



for x in a:

    MAP[x] = -1



MAP[0] = 1 

for i in range(N):

    if MAP[i] < 0:

        continue



    MAP[i] %= MOD

    if i + 1 <= N and MAP[i+1] >= 0:

        MAP[i+1] += MAP[i]

    if i + 2 <= N and MAP[i+2] >= 0:

        MAP[i+2] += MAP[i]



print((MAP[N] % MOD))

from functools import lru_cache
import sys

sys.setrecursionlimit(30000)
N, M = list(map(int, input().split()))
a = list(int(eval(input())) for _ in range(M))
MOD = pow(10, 9) + 7
isOk = True
for i in range(M - 1):
    if a[i] + 1 == a[i + 1]:
        isOk = False
funcb = [-1] * 100001


def func(n):
    if n <= 0:
        return 1
    cnt = funcb[n]
    if cnt > 0:
        return cnt
    cnt = 0
    if n >= 2:
        cnt += func(n - 2)
    if n >= 1:
        cnt += func(n - 1)
    funcb[n] = cnt % MOD
    return funcb[n]


func(30000)
func(50000)
func(80000)
func(100000)
if not isOk:
    print((0))
else:
    ans = 1
    s = 0
    for i in range(M + 1):
        if i >= M:
            e = N
        else:
            e = a[i] - 1
        ans = ans * func(e - s) % MOD
        if i >= M:
            break
        s = a[i] + 1
    print(ans)

N, M = list(map(int, input().split()))
a = list(int(eval(input())) for _ in range(M))
MOD = pow(10, 9) + 7
MAP = [0] * (N + 1)
for x in a:
    MAP[x] = -1
MAP[0] = 1
for i in range(N):
    if MAP[i] < 0:
        continue
    MAP[i] %= MOD
    if i + 1 <= N and MAP[i + 1] >= 0:
        MAP[i + 1] += MAP[i]
    if i + 2 <= N and MAP[i + 2] >= 0:
        MAP[i + 2] += MAP[i]
print((MAP[N] % MOD))

-from functools import lru_cache -import sys - -sys.setrecursionlimit(30000) -isOk = True -for i in range(M - 1): -    if a[i] + 1 == a[i + 1]: -        isOk = False -funcb = [-1] * 100001 - - -def func(n): -    if n <= 0: -        return 1 -    cnt = funcb[n] -    if cnt > 0: -        return cnt -    cnt = 0 -    if n >= 2: -        cnt += func(n - 2) -    if n >= 1: -        cnt += func(n - 1) -    funcb[n] = cnt % MOD -    return funcb[n] - - -func(30000) -func(50000) -func(80000) -func(100000) -if not isOk: -    print((0)) -else: -    ans = 1 -    s = 0 -    for i in range(M + 1): -        if i >= M: -            e = N -        else: -            e = a[i] - 1 -        ans = ans * func(e - s) % MOD -        if i >= M: -            break -        s = a[i] + 1 -    print(ans) +MAP = [0] * (N + 1) +for x in a: +    MAP[x] = -1 +MAP[0] = 1 +for i in range(N): +    if MAP[i] < 0: +        continue +    MAP[i] %= MOD +    if i + 1 <= N and MAP[i + 1] >= 0: +        MAP[i + 1] += MAP[i] +    if i + 2 <= N and MAP[i + 2] >= 0: +        MAP[i + 2] += MAP[i] +print((MAP[N] % MOD))