# -*- coding: utf-8 -*-

# N : 階段の段数, M : 壊れている段の数
N, M = map(int, input().split())
a = []
for n in range(M):
    a.append(int(input()))


def culcContinueSitu(n):
    # n段連続で使える階段がある場合の登り方を数える
    if n == 1:
        return 1
    elif n == 2:
        return 2
    elif n >= 3:
        # 最初の1段目で飛ばすとき：culcContinueSitu(n-2)を数えれば良い
        # 最初の1段目で飛ばさないとき：culcContinueSitu(n-1)を数えれば良い
        return culcContinueSitu(n-2) + culcContinueSitu(n-1)


if M > 0:
    num_case = 1
    start = 0
    end = N
    for i in range(M):
        if i >= 1 and a[i]-a[i-1] <= 1:
            num_case = 0
            break
        if i >= 1:
            start = a[i-1] + 1
        end = a[i] - 1
        if end == 0:
            continue
        num_case *= culcContinueSitu(end - start)
    if N - a[M-1] > 1 and num_case != 0:
        start = a[M-1] + 1
        end = N
        num_case *= culcContinueSitu(end - start)
else:
    num_case = culcContinueSitu(N)

print(num_case % 1000000007)
