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

group = []

MOD = 1000000007

if M == 0:
    group.append(N)
else:
    pre_a = int(input())
    group.append(pre_a)

    for i in range(M-1):
        a = int(input())
        tmp = a - pre_a - 1
        pre_a = a
        group.append(tmp)
    group.append(N - pre_a)

if 0 in group:
    print(0)
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)
