using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static void Main(String[] args) { int n = Convert.ToInt32(Console.ReadLine()); string[] m_temp = Console.ReadLine().Split(' '); int[] m = Array.ConvertAll(m_temp, Int32.Parse); // your code goes here int theLnght = m.Length; Int64 theBigNumber = 0; for (int j = 1; j <= theLnght; j++) { Int64 theLoopNumber = 1; for (int i = theLnght; i >= 1; i--) { theLoopNumber *= i; } theBigNumber += theLoopNumber; } int tobePrinted = (int)((theBigNumber % (7 + Math.Pow(10.0, 9.0)))/4); Console.WriteLine(tobePrinted); } }