n, m = map(int, input().split())
a = [int(input()) for i in range(m)]
interval_max = 0
for i in range(len(a)-1):
    if a[i+1] - a[i] == 1:
        print(0)
        exit()
    interval_max = max(interval_max, a[i+1] - a[i])
a.insert(0, 0)
a.append(n)
for i in range(len(a)-1):
    interval_max = max(interval_max, a[i+1] - a[i])

step = [0]*interval_max
step[0] = step[1] = 1
for i in range(2,interval_max):
    step[i] = (step[i-2] + step[i-1])
sum_step = 1
for i in range(len(a)-1):
    sum_step *= step[a[i+1] - a[i] - 1]
sum_step = sum_step % 1000000007
print(sum_step)