using System;
    class Program
    {
        static void Main(string[] args)
        {
            string[] xInputMax = "6 5".Split(' ');
            //string[] xInputMax = Console.ReadLine().Split(' ');
            int xMaxX = int.Parse(xInputMax[0]);
            int xMaxY = int.Parse(xInputMax[1]);

            long xSumX = SumAreaLength(Console.ReadLine(), xMaxX);
            long xSumY = SumAreaLength(Console.ReadLine(), xMaxY);

            long xDivisor = 1000000007;
            Console.WriteLine(((xSumX % xDivisor) * (xSumY % xDivisor)) % xDivisor);
        }

        static long SumAreaLength(string xInputString, int xMaxCount)
        {
            string[] xInput = xInputString.Split(' ');
            long xSum = 0;
            for (int i = 0; i < xMaxCount; ++i)
            {
                xSum += long.Parse(xInput[i]) * (2 * i - xMaxCount + 1);
            }
            return xSum;
        }
    }