using System;
    class Program
    {
        static void Main(string[] args)
        {
            //入力
            string[] xInputMax = Console.ReadLine().Split(' ');
            int xMaxX = int.Parse(xInputMax[0]);
            int xMaxY = int.Parse(xInputMax[1]);
            string[] xInputX = Console.ReadLine().Split(' ');
            int[] x = new int[xMaxX];
            for (int i = 0; i < xMaxX; ++i)
            {
                x[i] = int.Parse(xInputX[i]);
            }
            string[] xInputY = Console.ReadLine().Split(' ');
            int[] y = new int[xMaxY];
            for (int i = 0; i < xMaxY; ++i)
            {
                y[i] = int.Parse(xInputY[i]);
            }
            //計算
            long xOutput = 0;
            for (int i = 0; i < xMaxX - 1; ++i)
            {
                for (int j = i + 1; j <= xMaxX - 1; ++j)
                {
                    for (int k = 0; k < xMaxY - 1; ++k)
                    {
                        for (int l = k + 1; l <= xMaxY - 1; ++l)
                        {
                            long xNewOutput = (((long)x[j] - x[i]) * ((long)y[l] - y[k])) % 1000000007;
                            xOutput = (xOutput + xNewOutput) % 1000000007;
                        }
                    }
                }
            }
            //出力
            Console.WriteLine(xOutput);
        }
    }