import numpy as np

n, m = map(int, input().split())

a = []

for i in range(m):
    a.append(int(input()))
a.append(n)


def fib_memo(n):
    """メモ化フィボナッチ"""
    memo = [0] * (n + 1)

    def _fib(n):
        if n <= 1:
            return n
        if memo[n] != 0:
            return memo[n]
        memo[n] = _fib(n - 1) + _fib(n - 2)
        return memo[n]

    return _fib(n)


for i in range(1, len(a)):
    sa = a[i] - a[i - 1]
    if sa == 1:
        print("0")
        exit()

a2 = []
for i in range(len(a)):
    if i == 0:
        a2.append(fib_memo(a[i]))
    elif i == (len(a) - 1):
        a2.append(fib_memo(a[i] - a[i - 1]))
    else:
        a2.append(fib_memo(a[i] - a[i - 1]) - 1)

print(np.prod(a2) % 1000000007)
