import math

N, M = map(int, input().split())

ng = 0
INF = pow(10, 9) + 7
ans = 1
now = 0
if M == 0:
    last = N
    if last % 2 == 0:
        tmp = 1
        i = int(last / 2)
        for j in range(1, i + 1):
            tmp += int(math.factorial(i + j) / (math.factorial(2 * j) * math.factorial(i - j)))
        ans *= tmp
        ans %= INF
    else:
        i = int(last / 2)
        tmp = i + 1
        for j in range(1, i + 1):
            tmp += int(math.factorial(i + j + 1) / (math.factorial(2 * j + 1) * math.factorial(i - j)))
        ans *= tmp
        ans %= INF
else:
    for ind in range(M):
        nex = int(input())
        broken = nex - now - 2
        if ind != 0 and broken == 0:
            ng = 1
            break
        if broken % 2 == 0:
            tmp = 1
            i = int(broken / 2)
            for j in range(1, i+1):
                tmp += int(math.factorial(i+j) / (math.factorial(2*j) * math.factorial(i-j)))
            ans *= tmp
            ans %= INF
        else:
            i = int(broken / 2)
            tmp = i + 1
            for j in range(1, i+1):
                tmp += int(math.factorial(i+j+1) / (math.factorial((2*j)+1) * math.factorial(i-j)))
            ans *= tmp
            ans %= INF
        now = nex
    else:
        last = N
        broken = last - now - 1
        if broken == 0:
            ng = 1
        if broken % 2 == 0:
            tmp = 1
            i = int(broken / 2)
            for j in range(1, i+1):
                tmp += int(math.factorial(i+j) / (math.factorial(2*j) * math.factorial(i-j)))
            ans *= tmp
            ans %= INF
        else:
            i = int(broken / 2)
            tmp = i + 1
            for j in range(1, i+1):
                tmp += int(math.factorial(i+j+1) / (math.factorial((2*j)+1) * math.factorial(i-j)))
            ans *= tmp
            ans %= INF

if ng:
    print(0)
else:
    print(ans)