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


def Fib(num):
    a, b = 1, 0
    for _ in range(num):
        a, b = (a + b) % 1000000007, a % 1000000007
    return (a)


def stepcount(x, y):
    if y - x <= 1:
        return 1
    else:
        return Fib(y - x)


answer = Fib(outlist[0] - 1)

for i in range(m - 1):
    answer *= stepcount(outlist[i] + 1, outlist[i + 1] - 1)
    answer = answer % 1000000007

answer = (answer * stepcount(outlist[m - 1] + 1, n)) % 1000000007

for i in range(m - 1):
    if outlist[i + 1] - outlist[i] == 1:
        answer = 0

print(answer)