using System;
using System.Collections.Generic;
using System.Linq;

namespace _058
{
    class Program
    {
        // 058-D
        static void Main(string[] args)
        {
            var line = Console.ReadLine().Split(' ').Select(a => long.Parse(a)).ToArray();
            long n = line[0];
            long m = line[1];
            var x = Console.ReadLine().Split(' ').Select(a => long.Parse(a)).ToArray();
            var y = Console.ReadLine().Split(' ').Select(a => long.Parse(a)).ToArray();

            long s = 0;
            long s1 = 0;
            long s2 = 0;
            for (long j = 1; j <= n; j++)
            {
                for (long i = 1; i < j; i++)
                {
                    s1 += x[j - 1] - x[i - 1];
                    s1 = s1 % ((long)Math.Pow(10, 9) + 7);
                }
            }
            for (long l = 1; l <= m; l++)
            {
                for (long k = 1; k < l; k++)
                {
                    s2 += (y[l - 1] - y[k - 1]);
                    s2 = s2 % ((long)Math.Pow(10, 9) + 7);
                }
            }
            s = (s1*s2) % ((long)Math.Pow(10, 9) + 7);
            Console.WriteLine(s);
        }
    }
}
