n, m = map(int, input().split())
li = [int(input()) for _ in range(m)]
li.append(n+1)
ans_li=[0 for i in range(m+1)]
global count

def counter( start, end):
    global count
    if start == end:
        count+=1
    elif start > end:
        return
    else:
        counter(start+1, end)
        counter(start+2, end)

start_pos = 0
for i in range(0, m+1):
    count = 0
    if start_pos == li[i]-1:
        start_pos = li[i]+1
        continue
    counter(start_pos, li[i]-1)
    start_pos = li[i]+1
    ans_li[i] = count

ans = 1
for i in ans_li:
    ans *=i
print(ans)