# -*- coding: utf-8 -*-
"""
Created on Sun Jun  9 21:02:21 2019

@author: hisaki
"""


import numpy as np

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result
    
def func( x , y ):
    bet = y -x
    two_num = int(bet/2)
    s  = 0
    for i in range(two_num):#2の個数分ループ        
        s += cmb(bet-i,i)
        
    return s


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

a = np.zeros(N,dtype = 'int64')

for i in range(M):
    a_temp = int(input())
    a[i] = a_temp

for i in range(M):
    if i == 0:
        continue
    if a[i]-a[i-1] == 1:
        print(0)
        exit(0)

s = np.ones(M)

for i in range(M):
    if i+1==M:#最後の計算
        s[i] = func(a[i]+1,N-1)
    
    else:
        s[i] = func(a[i]+1,a[i+1]-1)


s_multi = 1
for i in s:
    i = int(i)
    s_multi *= s[i]

print (int(s_multi))
#print(s_multi%1000000007)

