using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication4
{
    class Program
    {
        static void Main()
        {
            string read = Console.ReadLine();
            string[] split = read.Split(' ');
            int n = Int32.Parse(split[0]);
            int m = Int32.Parse(split[1]);

            read = Console.ReadLine();
            split = read.Split(' ');
            long[] x = new long[n];
            for (int c = 0; c < n; c++)
            {
                x[c] = Int64.Parse(split[c]);
            }
            read = Console.ReadLine();
            split = read.Split(' ');
            long[] y = new long[m];
            for (int c = 0; c < m; c++)
            {
                y[c] = Int64.Parse(split[c]);
            }
            Array.Sort(x);
            Array.Sort(y);
            long juunana = 1000000007;
            long output = 0;


            for (int xstart = 0; xstart < x.Length - 1; xstart++)
                for (int ystart = 0; ystart < y.Length - 1; ystart++)
                    for (int xend = xstart + 1; xend < x.Length; xend++)
                        for (int yend = ystart + 1; yend < y.Length; yend++)
                        {
                            output += (y[yend] - y[ystart]) * (x[xend] - x[xstart]);
                            output = output % juunana;
                        }
            Console.WriteLine(output);

        }


    }
}
