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 = []
#aa.append(a[0]-)
for k in range(M-1):
    aa.append(a[k+1] - a[k] - 1)
#aa.append(N - a(M))

if 0 in aa:
    ans = 0

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

	ans_list.append(fibo(a[1])
	ans_list.append(fibo(N - a[M]))

	ans = (sum(ans_list) // (10**9 + 7))

print(ans)
