N,M = map(int,input().split())
pre_a = -1
k = []
ef = True
for i in range(M):
    a = int(input())
    if (a-pre_a == 1):break
    k.append(a-pre_a-2)
    pre_a = a
else:
    ef = False
    k.append(N-a-1)
nk = sorted(k)
def org_fib(t):
    t1 = 1
    t2 = 2
    fib = 0
    if t == 1:
        return t1
    elif t == 2:
        return t2
    else:
        for _ in range(t-2):
            fib = t1+t2
            t1 = t2
            t2 = fib
    return fib

if ef:print(0)
else:
    g = 1
    for nnkk in nk:
        if nnkk == 0:
            pass
        else:
            g = (g * org_fib(nnkk)) % 1000000007
    print(g)