using System;

public class Hello
{
    public const long SS = 1000000007;
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var m = int.Parse(line[1]);
        line = Console.ReadLine().Trim().Split(' ');
        var x = Array.ConvertAll(line, long.Parse);
        line = Console.ReadLine().Trim().Split(' ');
        var y = Array.ConvertAll(line, long.Parse);
        var wsum = 0L;
        for (int i = 0; i < n - 1; i++)
            for (int j = i + 1; j < n; j++)
                for (int k = 0; k < m - 1; k++)
                    for (int L = k + 1; L < m; L++)
                    {
                        var w1 = (x[j] - x[i]) % SS;
                        var w2 = (y[L] - y[k]) % SS;
                        wsum += (w1 * w2) % SS;
                        wsum = wsum % SS;
                    }
        Console.WriteLine(wsum);
    }
}