N,M = map(int,input().split())
l = [int(input()) for i in range(M)]
sub = [0 for i in range(M+1)]
for i in range(1,M):
    sub[i] = l[i] - l[i-1] -1
sub[0] = l[0]
sub[M] = N-l[M-1]
print(sub)
max = max(sub)
list = [1 for i in range(max+1)]
for i in range(3,max+1):
        list[i] = list[i-1]+list[i-2]
list[0] = 0
ans = 1
for i in sub:
    ans *= list[i]
    ans = ans % 1000000007

print(ans)
