from functools import lru_cache
import sys
sys.setrecursionlimit(10**5)
N , M = map(int ,input().split())
mod = 10 ** 9 + 7
A = []
for i in range(M):
    A.append(int(input()))
    if A[i] - 1 == A[i - 1] and i > 0:
        print("0")
        exit()

@lru_cache(maxsize=None)
def fib(n):
    if n == 0 or n == 1:
        return 1
    else:
        return fib(n - 1)+fib(n - 2)
ans = 1
now = 0
for a in A:
    next = a - 1
    ans *= fib(next - now)
    now = a + 1
if now == 0:
    ans = fib(N)
else:
    ans *= fib(N - now)
print(ans % mod)