def Fib(n):
    s, t = 0, 1
    if n == 1:
        return s
    elif n == 2:
        return t
    else:
        for i in range(n-2):
            s, t = t, s + t
        return t
def FIB(q):
    return Fib(q+1)

n,m = map(int,input().split())
A =[]
add = 1
ex = 0
y = 0
for _ in range(m):
    a = int(input())
    A.append(a)
for i in range(1,n+1):
    if A.count(i) == 1 and A.count(i+1) == 1 :
        ex += 1
    else:
        ex += 0
if ex >= 1:
    print(0)
else:
    if A[0] == 1:
        if m ==1:
            add *= FIB(n - 1)
        else:
            for j in range(0,m-1):
                y = A[j+1]-A[j] -1
                add *= FIB(y)
            add *= FIB(n-A[m-1])
    else:
        if m == 1:
            z =0
            for l in range(1,A[0]):
                z += FIB(l)
            add *= z*(FIB(n - A[0]))
        else:
            c = 0
            for u in range(1,A[0]):
                c += FIB(u)
                add *=c
            for k in range(0,m-1):
                y = A[k+1]-A[k] -1
                add *= FIB(y)
            add *= FIB(n - A[m-1])

    print(add % 1000000007)
