combinations :: Int -> [a] -> [[a]]
combinations n xs = comb n (length xs) xs where
  comb 0 _ _ = [[]]
  comb r n a@(x:xs)
    | n == r    = [a]
    | otherwise = map (x:) (comb (r - 1) (n - 1) xs) ++ comb r (n - 1) xs

main = do
 getLine
 aList <- map read . words <$> getLine :: IO [Integer]
 let a = combinations 2 aList
 let c = map (flip mod 1000000007) $ map product a
 let b = (foldl (+) 0 c) `mod` 1000000007
 print b