My doubt is regarding Facto sum question in hackerblocks

only one test case is passing… sir pls tell whats the error in the code…

#include
using namespace std;

int fact(int n){
if(n==0){
return 1;
}

return n*fact(n-1);

}

int main(){
int n,i,arr[100];
cin>>n;
for(i=0;i<n;i++){
cin>>arr[i];
}
int sum1=0,p;
for(i=0;i<n;i++){
p=fact(arr[i]);
sum1=sum1+p;
}
int ans=sum1%107;
cout<<ans;
return 0;

}