n,m=map(int,input().split())
a=[]
for i in range(0,m):
    a.append(input())
    a[i]=int(a[i])
b=[a[0]-1]
for i in range(1,len(a)):
    b.append(a[i]-a[i-1]-1)
b.append(n-a[i]-1)
c,d=0,1
e=b
for i in range(0,max(b)):
    c,d=d,c+d
    for k in range(0,len(b)):
        if b[k]==i+1:
            e[k]=d
answer=1
for i in range(0,len(e)):
    answer=answer*e[i]
print(answer)