#include <iostream>
#include <cstdio>
using namespace std;
typedef long long LL;
LL c[13][13];
void init(){
for(int i = 0; i < 13; i++){
c[i][0] = 1;
for(int j = 1; j < i; j++)
c[i][j] = c[i-1][j]+c[i-1][j-1];
c[i][i] = 1;
}
}
/**
C[][]
n!/(n1!*n2!*...*nk!)
**/
int main()
{
// freopen("data.in", "r", stdin);
int n, k, x;
LL ans;
init();
while(scanf("%d%d", &n, &k) != EOF){
ans = 1;
while(k--){
scanf("%d", &x);
ans *= c[n][x];
n-=x;
}
printf("%lld\n", ans);
}
return 0;
}