n, m = (int(i) for i in input().split())  
a = [int(input()) for i in range(m)] 

from operator import mul
from functools import reduce
import itertools

a.append(n)
a.insert(0, 0)
def count_ways(steps, jumps):
    jav_steps = steps - 2
    ls = list(itertools.combinations(range(jav_steps), jumps))
    return len(ls)
    
def count_block(b1, b2):
    steps = b2 - b1
    jump_types = steps//2 + 1
    block_ans = sum([count_ways(steps, jumps) for jumps in range(1, jump_types-1)])    
    return block_ans

ans  = [count_block(a[i], a[i+1]) for i in range(len(a)-1) if a[i+1]!=1]

print(reduce(mul, ans))