using System;
using System.Linq;

namespace ABC058D
{
    class Program
    {
        static void Main(string[] args)
        {
            Solver solver = new Solver();
            solver.Solve();
        }
    }

    class Solver

    {
        private int N;
        private int M;
        private long[] NComb;
        private long[] MComb;
        private long Big;

        public void Solve()
        {
            int[] ints = Console.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
            N = ints[0];
            M = ints[1];
            NComb = new long[N + 1];
            MComb = new long[M + 1];
            setComb();
            Big = (long) Math.Pow(10, 9) + 7;

            long[] x = Console.ReadLine().Split(' ').Select(b => long.Parse(b)).ToArray();
            long[] y = Console.ReadLine().Split(' ').Select(c => long.Parse(c)).ToArray();

            long nLength = 0;

            for (int i = 0; i < N - 1; i++)
            {
                nLength += (x[i + 1] - x[i]) % Big * NComb[i + 1] % Big;
                nLength %= Big;
            }

            long mLength = 0;

            for (int i = 0; i < M - 1; i++)
            {
                mLength += (y[i + 1] - y[i]) % Big * MComb[i + 1] % Big;
                mLength %= Big;
            }

            Console.WriteLine(nLength * mLength % Big);
        }

        public void setComb()
        {
            for (int i = 1; i <= N; i++)
            {
                NComb[i] = i * (N - i);
            }

            for (int i = 1; i <= M; i++)
            {
                MComb[i] = i * (M - i);
            }
        }
    }
}