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

namespace d
{
    class Program
    {
        const long MOD = 1000000007;

        static void Main(string[] args)
        {
            var nmstr = Console.ReadLine().Split(' ');
            var n = int.Parse(nmstr[0]);
            var m = int.Parse(nmstr[1]);

            var xstr = Console.ReadLine().Split(' ');
            var x = new long[n];
            for (var i = 0; i < n; i++)
            {
                x[i] = long.Parse(xstr[i]);
            }

            var ystr = Console.ReadLine().Split(' ');
            var y = new long[m];
            for (var i = 0; i < m; i++)
            {
                y[i] = long.Parse(ystr[i]);
            }

            var xsum = 0L;
            for (var i = 0; i < n; i++)
            {
                xsum += ((2 * i - n + 1) * x[i]);
            }

            var ysum = 0L;
            for (var i = 0; i < m; i++)
            {
                ysum += ((2 * i - m + 1) * y[i]);
            }

            var totalArea = (xsum * ysum) % MOD;

            Console.WriteLine(totalArea);
        }
    }
}
