N,M = map(int,input().split())
a = []
for i in range(M):
    a.append(int(input()))

def fibo(x2):
    if (x2 == 1) or (x2 == 2):
        return (1)
    else:
        return((fibo(x2-1) + fibo(x2-2)) % (10**9 + 7))

aa = [] #aの差を取ったもののリスト
for k in range(M-1):
    aa.append(a[k+1] - a[k] - 1)
#print(aa)
#aa.append(N - a(M))

if 0 in aa:
    ans = 0

else:
    ans = 1
    ans_list = []
    for i in range(M-1):
        if aa[i] >= 1:
            ans_list.append(fibo(aa[i]))

    ans_list.append(fibo(a[0]))
    ans_list.append(fibo(N - a[M-1]))
    #print(ans_list)
    
    for i in range (len(ans_list)):
        ans = (ans * ans_list[i]) % (10**9 + 7)

print(ans)
