Time limit
2s
Memory limit
512 MB
You are given N integers X1,X2,…,XN. For each ordered pair (i,j), define Yi,j=Xi×Xjmod359999.
Count the number of ordered 6-tuples (a,b,c,d,e,f) that satisfy all of the following conditions.
Use gcd(0,0)=0 in this definition.
The first line contains the integer N.
The second line contains X1,X2,…,XN, separated by spaces.
Print the number of ordered 6-tuples satisfying the condition, modulo 109+7.