package main import ( "bufio" "fmt" "io" "os" ) var modVar = int64(1e9) + int64(7) func solve(in io.Reader, out, err io.Writer) { num, total, size := 0, int64(0), 100 fmt.Fscan(in, &num) bamboo := make([]int64, size) for temp, i := 0, 0; i < num; i++ { fmt.Fscan(in, &temp) bamboo[temp-1]++ } for i := 0; i < size-2; i++ { if bamboo[i] == 0 { continue } for jj := i + 1; jj < size-1; jj++ { if bamboo[jj] == 0 { continue } for kkk := jj + 1; kkk < size; kkk++ { if bamboo[kkk] == 0 { continue } total += bamboo[i] * bamboo[jj] * bamboo[kkk] } } } result := int(total % modVar) fmt.Fprintln(out, result) } func main() { big := int(1e6) br := bufio.NewReaderSize(os.Stdin, big) solve(br, os.Stdout, os.Stderr) }