#!/usr/bin/python3
from math import factorial

while True:
  try:
    line = input()
    n, k = list(map(int, line.split()))
    line = list(map(int, input().split()))

    # Solution = n!/ (n1! n2! n3! ... nk!)
    solution = factorial(n)
    for nk in line:
      solution /= factorial(nk) 
    
    print(int(solution))
  
  except EOFError:
    break


7b1a87a7e9154b62ab5b7e8cc654cccbb5d23d69
<mask token>

<mask token>
while True:
    try:
        line = input()
        n, k = list(map(int, line.split()))
        line = list(map(int, input().split()))
        solution = factorial(n)
        for nk in line:
            solution /= factorial(nk)
        print(int(solution))
    except EOFError:
        break

from math import factorial
while True:
    try:
        line = input()
        n, k = list(map(int, line.split()))
        line = list(map(int, input().split()))
        solution = factorial(n)
        for nk in line:
            solution /= factorial(nk)
        print(int(solution))
    except EOFError:
        break

#!/usr/bin/python3
from math import factorial

while True:
  try:
    line = input()
    n, k = list(map(int, line.split()))
    line = list(map(int, input().split()))

    # Solution = n!/ (n1! n2! n3! ... nk!)
    solution = factorial(n)
    for nk in line:
      solution /= factorial(nk) 
    
    print(int(solution))
  
  except EOFError:
    break

