#include <iostream> using namespace std; int A[] = {1,1,2,6,24,120,720,5040,40320,362880,3628800,39916800,479001600}; int main() { int n,k; while (scanf("%d %d",&n,&k) != EOF) { int sum = A[n],temp; for (int i = 0; i < k; ++i) { scanf("%d",&temp); sum /= A[temp]; } cout << sum << endl; } return 0; }