N, M = map(int, input().split())

group = []

MOD = 1000000007

pre_a = int(input())
group.append(pre_a)

ok = True
for i in range(M-1):
    a = int(input())
    tmp = a - pre_a - 1
    pre_a = a
    if tmp == 1:
        ok = False
    else:
        group.append(tmp)
    if not ok:
        break
group.append(N - pre_a)

if not ok:
    print(0)
elif max(group) == 1:
    print(1)
else:
    fiv = [0 for i in range(max(group))]
    fiv[0] = 1
    fiv[1] = 1
    for i in range(2, len(fiv)):
        fiv[i] = (fiv[i-1] + fiv[i-2]) % MOD
    ans = 1
    for g in group:
        ans *= fiv[g-1]
    print(ans%MOD)
