cache = {1: int(1), 2: int(2)}


def calc(_n):
    if _n in cache:
        return cache[_n]
    else:
        x = int(calc(_n - 1) + calc(_n - 2))
        cache[_n] = x
        return x


N, M = map(int, raw_input().split())
prev_a = int(-1)
ans = int(1)

for i in range(3, N):
    x = cache[i-2] + cache[i-1]
    cache[i] = x

for i in range(0, M):
    a = int(input())
    if a == 1:
        prev_a = 1
    elif prev_a + 1 == a:
        ans = 0
        break
    else:
        ans = ans * calc(a - prev_a - 2)
        prev_a = a

if ans == 0:
    print(ans)
else:
    if prev_a + 1 == N:
        ans = ans
    elif prev_a != N:
        ans = ans * calc(N - prev_a - 1)
    print(ans % 1000000007)

