n, m = [int(i) for i in input().split()]

a = [-1] + [int(eval(input())) for _ in range(m)] + [n+1]



fib_l = [-1] * (n+3)



def make_fib(n):

    fib_l[0] = fib_l[1] = 1

    for i in range(2, n):

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



make_fib(n+3)

ret = 1

for i in range(m+1):

    t = a[i+1] - a[i] - 2

    if t < 0:

        ret = 0

        break

    ret *= fib_l[t]

print((ret % 1000000007))
from sys import stdin



n, m = [int(i) for i in stdin.readline().rstrip().split()]

a = [-1] + [int(stdin.readline()) for _ in range(m)] + [n+1]



fib_l = [-1] * (n+3)



def make_fib(n):

    fib_l[0] = fib_l[1] = 1

    for i in range(2, n):

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



make_fib(n+3)

ret = 1

for i in range(m+1):

    t = a[i+1] - a[i] - 2

    if t < 0:

        ret = 0

        break

    ret *= fib_l[t]

print((ret % 1000000007))
n, m = [int(i) for i in input().split()]
a = [-1] + [int(eval(input())) for _ in range(m)] + [n + 1]
fib_l = [-1] * (n + 3)


def make_fib(n):
    fib_l[0] = fib_l[1] = 1
    for i in range(2, n):
        fib_l[i] = fib_l[i - 1] + fib_l[i - 2]


make_fib(n + 3)
ret = 1
for i in range(m + 1):
    t = a[i + 1] - a[i] - 2
    if t < 0:
        ret = 0
        break
    ret *= fib_l[t]
print((ret % 1000000007))

from sys import stdin

n, m = [int(i) for i in stdin.readline().rstrip().split()]
a = [-1] + [int(stdin.readline()) for _ in range(m)] + [n + 1]
fib_l = [-1] * (n + 3)


def make_fib(n):
    fib_l[0] = fib_l[1] = 1
    for i in range(2, n):
        fib_l[i] = fib_l[i - 1] + fib_l[i - 2]


make_fib(n + 3)
ret = 1
for i in range(m + 1):
    t = a[i + 1] - a[i] - 2
    if t < 0:
        ret = 0
        break
    ret *= fib_l[t]
print((ret % 1000000007))

-n, m = [int(i) for i in input().split()] -a = [-1] + [int(eval(input())) for _ in range(m)] + [n + 1] +from sys import stdin + +n, m = [int(i) for i in stdin.readline().rstrip().split()] +a = [-1] + [int(stdin.readline()) for _ in range(m)] + [n + 1]