Doubt regarding Facto Sum problem

import java.util.*;
public class Main {
public static void main(String args[]) {

	Scanner scan = new Scanner(System.in) ;
	int t = scan.nextInt() ;
	double sum = 0 ;
	while(t-- > 0){
		int n = scan.nextInt() ;
		sum += facto(n) ;
	}

	System.out.println(Math.round(sum) % 107) ;

}

public static double facto(int n){

	if(n == 0)
	  return 1 ;

	double smallAns = facto(n-1) ;
	return n * smallAns ;
}

}

This is the code I have written to this problem.Out of 7 test cases only 1 test case is failing , Can you tell me where I have committed the mistake in this problem

@Lalit2142,
Can you share the correct question link?

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.