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

namespace sikakukei4_30
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] nm = Console.ReadLine().Split(' ');
            string[] xtext = Console.ReadLine().Split(' ');
            string[] ytext = Console.ReadLine().Split(' ');

            int n = int.Parse(nm[0]);
            int m = int.Parse(nm[1]);


            int[] x = new int[n];
            int[] y = new int[m];
            for (int i = 0; i < n; i++)
            {
                x[i] = Convert.ToInt32(xtext[i]);
            }

            for (int j = 0; j < m; j++)
            {
                y[j] = Convert.ToInt32(ytext[j]);
                
            }
           

            int answer = 0;
            int answerx = 0;
           
            for(int k = 0; k < n; k++)
            {
               
                answerx = answerx + (2 * (k+1 ) - n - 1) *x[k];

                
            }

            int answery = 0;
            for (int l= 0; l < m; l++)
            {
                answery = answery + (2 * (l + 1) - m - 1) *y[l];
            }

            

            answer = (answerx) * (answery);

            
          int answer2=answer% Convert.ToInt32(Math.Pow(10, 9)+7);
            

            Console.WriteLine(answer2.ToString());

            

        }
    }
}
