using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    const long Hou = 1000000007;

    static string InputPattern = "Input1";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("3 3");
            WillReturn.Add("1 3 4");
            WillReturn.Add("1 3 6");
            //60
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("6 5");
            WillReturn.Add("-790013317 -192321079 95834122 418379342 586260100 802780784");
            WillReturn.Add("-253230108 193944314 363756450 712662868 735867677");
            //835067060
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();
        int[] XArr = InputList[1].Split(' ').Select(A => int.Parse(A)).ToArray();
        int[] YArr = InputList[2].Split(' ').Select(A => int.Parse(A)).ToArray();

        long SenbunSumX = DeriveSenbunSum(XArr);
        long SenbunSumY = DeriveSenbunSum(YArr);

        long Answer = SenbunSumX * SenbunSumY;
        Answer %= Hou;
        Console.WriteLine(Answer);
    }

    //座標の配列を引数として、作成可能な線分の長さの総和を返す
    static long DeriveSenbunSum(int[] pArr)
    {
        int UB = pArr.GetUpperBound(0);
        long SenbunSum = 0;
        for (int I = 0; I <= UB; I++) {
            long CurrPos = pArr[I] % Hou;
            int KeisuuMinus = I;
            int KeisuuPlus = UB - I;
            SenbunSum += -CurrPos * KeisuuMinus;
            SenbunSum %= Hou;
            SenbunSum += CurrPos * KeisuuPlus;
            SenbunSum %= Hou;
        }
        return SenbunSum;
    }
}
