Problem Link https://online.codingblocks.com/player/2612/content/786
#include
using namespace std;
long long factorial(long long num){
long long fact = 1;
for(long long i = num; i >=1 ;i–)
fact *= i;
return fact;
}
int main() {
long long n,res=0;
cin>>n;
long long arr[15];
for(long i =0 ;i < n; i++){
cin>>arr[i];
}
for(long i =0 ;i < n; i++){
res += (factorial(arr[i])%107);
}
cout<<res<<endl;
return 0;
}