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

mod = 10 ** 9 + 7


def Fib(n, memo={}):
    if n == 1:
        return 0
    elif n == 2:
        return 1
    elif n in memo:
        return memo[n] % mod
    else:
        memo[n] = Fib(n - 1, memo) + Fib(n - 2, memo)
        return memo[n] % mod


A = list(int(input()) for i in range(m))


if m > 0:
    ans = Fib(A[0] + 1) % mod
    for i in range(m - 1):
        ans *= Fib(A[i + 1] - A[i])
        ans %= mod
        if A[i] + 1 == A[i + 1]:
            print(0)
            exit()
    ans *= Fib(n - A[-1] + 1)
    ans %= mod
else:
    ans = Fib(n + 2) % mod
print(ans)