import sys
n,m= map(int, input().split())
array = []
for i in range(m):
  array.append(int(input()))


for i in range(1,m):
    if array[i]-array[i-1] == 1:
        print(0)
        sys.exit()
sequence = [1,1]
for i in range(10**5 ):
    sequence.append(sequence[i+1]+sequence[i])


count = sequence[array[0]]
for i in range(1,m):
    count *= sequence[array[i]-array[i-1]]

count *= sequence[n- array[m-1]]

print(count%1000000007)
