import sys
sys.setrecursionlimit(10 ** 7)
 
 
def LI(): return [int(x) for x in sys.stdin.readline().split()]
 
 
def SI(): return input()
 
 
MOD = 1000000007
 
 
def comb(a, b):
    ans = 1
    for i in range(1, min(a-b, b)+1):
        ans *= a - i + 1
        ans //= i
        ans = ans % MOD
    return ans
 
 
def calc(N):
    r = 1
    for b in range(N//2):
        a = N - b*2
        r += comb(a+b, b)
        r %= MOD
    return r
 
 
def main():
    N, M = LI()
    now = 0
    ans = 1
    for _ in range(M):
        a = int(input())
        if a == now-1:
            continue
        if a == now:
            print(0)
            return
        ans = (ans*calc(a-now-1)) % MOD
        now = a+1
    ans = (ans*calc(N-now)) % MOD
    print(ans)
 
 
main()
import sys
sys.setrecursionlimit(10 ** 7)


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def SI(): return input()


MOD = 1000000007


def comb(a, b):
    ans = 1
    for i in range(1, min(a-b, b)+1):
        ans *= a - i + 1
        ans //= i
        ans = ans % MOD
    return ans


def calc(N):
    r = 1
    for b in range(N//2):
        a = N - b*2
        r += comb(a+b, b)
        r %= MOD
    return r


def main():
    N, M = LI()
    now = 0
    ans = 1
    for _ in range(M):
        a = int(input())
        if a == now-1:
            continue
        if a == now:
            print(0)
            return
        ans = (ans*calc(a-now-1)) % MOD
        now = a+1
    ans = (ans*calc(N-now)) % MOD
    print(ans)


main()
