import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

mm = 1000000007
n, m = na()
ai = [-1]
for i in range(m):
    ai.append(int(input()))
ai.append(n+1)
li = [1, 1]
for i in range(n-2):
    li.append(li[i] + li[i+1])
ans = 1
for i in range(len(ai) - 1):
    if ai[i+1] - ai[i] == 1:
        ans = 0
    else:
        ans *= li[(ai[i+1] - ai[i]) - 2]
        ans = ans % mm
print(ans)