//let input = "4\n141421356 17320508 22360679 244949";

function main(input){
  input = input.trim();
  let num = parseInt(input.split("\n")[0]);
  let list = input.split("\n")[1].split(" ");
  //console.log(list);
  let sum = 0;
  let answer = 0;
  let waru = 10**9+7;
  for(let i=0; i<list.length; i++){
    list[i] = parseInt(list[i]);
  }
  for(let i=0; i<list.length; i++){
    for(let j=i+1; j<list.length; j++){
      //console.log(list[i]*list[j]);
      sum += (list[i]*list[j]) % waru;
      sum = sum%waru;
    } // j
  } // i
  console.log(sum);
}
//main(input);
main(require("fs").readFileSync("/dev/stdin","utf8"));