N, M = map(int, input().split())
now = 0
count = 1
flag = True
for _ in range(M):
        a = int(input())
        if a == now:
                print(0)
                flag = False
                break
        else:
                dif = a - now - 1
                x = int(dif / 2)
                y = 0
                for i in range(x+1):
                        z = 1
                        j = dif - 2*i
                        for k in range(i):
                                z *= (i+j-k)/(i-k)
                        y += z
                        if y > 1000000007:
                                y = y % 1000000007
                count *= y
                count = count % 1000000007
                now = a + 1
if flag:
        dif = N - now
        x = int(dif/2)
        y = 0
        for i in range(x+1):
                z = 1
                j = dif - 2*i
                for k in range(i):
                        z *= (i+j-k)/(i-k)
                y += z
        count *= y
        print(int(count%1000000007))