import sys
from scipy.special import comb
# a = comb(n, r)
#a = comb(n, r, exact=True)

# L 段の階段を 1 or 2 段上り
# ２段を i 回 (i<L//2) 1段を j 回 (j = L - 2*i)
# L odd の場合
# i = 0~L//2

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

A = [0]*M

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

A.append(N+1) # goal

total_combo = 1
NOW = 0
for a in A:
    if NOW == a:
        print(0)
        sys.exit()
    L = a-1-NOW
    combo = 0
    for i in range(L//2 +1):
        j = L - 2*i
        combo += comb(j+1, i, exact=True)
    total_combo *= combo
    NOW = a + 1
    
print(total_combo)
