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