N,M = map(int,input().split())
pre_a = -1
k = []
ef = False
for i in range(M):
    a = int(input())
    if a == 1:pre_a = 1
    else:
        if a-pre_a == 1:
            ef = True
            break
        #print(a,pre_a)
        k.append(a-pre_a-2)
        #print(k)
        pre_a = a
else:
    if a < N:k.append(N-a-1)
#print(k)
nk = sorted(k)
#print('nk:',nk)
def fib(sorted_lis):
    t1 = 1
    t2 = 2
    retl = []
    fi = 0
    i = 0
    for k in range(max(sorted_lis)+1):
        if k == 0:fi = 1
        elif k == 1:fi = t1
        elif k == 2:fi = t2
        else:
            fi = t1 + t2
            t1 = t2
            t2 = fi
        while (i < len(sorted_lis)) and (sorted_lis[i] == k):
            retl.append(fi % 1000000007)
            i += 1
    return retl
if ef:print(0)
else:
    cl = fib(nk)
    #print(cl)
    g = 1
    for kk in cl:g = (g * kk) % 1000000007
    print(g)