import math
CONST = 1000000007
n,m = map(int,input().split())
lis = []
prev = -1
for _ in range(m):
    a = int(input())
    if prev + 1 == a:
        print(0)
        exit()
    lis.append(a-prev-2)
    prev = a
lis.append(n-prev-1)


ans = 1
for v in lis:
    if v == 0: continue
    way = 0
    for two in range(v//2+1):
        one = v - two * 2
        comb = (math.factorial(one+two) // (math.factorial(one) * math.factorial(two))) % CONST
        way = (way + comb) % CONST
    ans = (ans * way) % CONST
print(ans)
