Facto sum problem

Given N numbers, calculate sum of their factorial modulo 107. (Note it is not 10^7)

Input Format
First line contains positive integer N and the next line contains N space separated integers.

Constraints
N <= 10 and all integers lie between 0 and 1000.

solution link: https://ide.codingblocks.com/s/280482

some test cases are not passing

you also need to take modulo while calculating factorial
Corrected Code