from itertools import permutations
n,m = map(int,input().split())
lst = [int(input()) for i in range(m)]
slst = []
cnt = 1

for i in range(m):
  if len(slst) == 0:
    slst.append(list(range(0,lst[i])))
  else:
    slst.append(list(range(lst[i-1]+1,lst[1])))
slst.append(list(range(lst[-1]+1,n+1)))
#print(slst)
for i in slst:
  if len(i) == 1:
    cnt*=1
  elif len(i) == 2:
    cnt*= 2
  elif len(i) == 3:
    cnt*= 3
  elif len(i) == 4:
    cnt*= 4
  elif len(i) == 5:
    cnt*= 7
  elif len(i) == 6:
    cnt*= 12
print(cnt)
"""
  for j in range(len(i)//2+1):
    tmp = [[2]*j+[1]*(len(i)-2*j)]
    plst = list(permutations(tmp))
    print(plst)
"""
  
