function Main(input) {
    input = input.split("\n");
    input = input[1].split(" ");

    for (i in input) {
        input[i] = Number(input[i]);
    }

    for (i in input) {
        input[i] = input[i] % 1000000007;
    }

    const tmp = [];
    for (let i = 0; i < input.length - 1; i++) {
        for (let j = i + 1; j < input.length; j++) {
            console.log(i + "a" + j);
            tmp.push((input[i] * input[j]) % 1000000007);
        }
    }
    var result =
        tmp.reduce(function (a, b) {
            return a + b;
        }) % 1000000007;
    console.log(result);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
