from math import factorial as f


N, M = map(int, input().split())
broken = [int(input()) for _ in range(M)] + [N+1]
tmp = 0
ans = 1
FLG = True

for a in broken:
    if a == 1:
        tmp = a + 1
        continue
    if a == tmp:
        FLG = False
        break

    interval = a - tmp - 1
    ans *= sum(int(f(j)/(f(i)*f(j-i))) for i,j in enumerate(range(interval, (interval+1)//2 - 1, -1)))
    tmp = a + 1

if FLG:
    print(ans % 1000000007)
else:
    print(0)