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

total = 1


def fib(n):
    a, b = 0, 1
    for i in range(n):
        a, b = b, a + b
    return b


i = 0
for x in a:
    if x == i:
        print(0)
        exit()
    total *= fib(x - i - 1)
    i = x + 1
total *= fib(n - a[-1] - 1)

print(total % 1000000007)