using System;
using System.Collections.Generic;

class Program
{
	static void Main(string[] args)
	{
		int xCount, yCount;
		string[] vals = Console.ReadLine().Split(' ');
		xCount = int.Parse(vals[0]);
		yCount = int.Parse(vals[1]);

		string[] strXSeq = Console.ReadLine().Split(' ');
		string[] strYSeq = Console.ReadLine().Split(' ');
		
		int[] xSeq = new int[strXSeq.Length];
		for(int i = 0 ; i < xSeq.Length ; i++){
			xSeq[i] = int.Parse(strXSeq[i]);
		}
		int[] ySeq = new int[strYSeq.Length];
		for(int i = 0 ; i < ySeq.Length ; i++){
			ySeq[i] = int.Parse(strYSeq[i]);
		}
		
		int sumSquare = 0;
		
		//all
		sumSquare += (Math.Abs(xSeq[xSeq.Length - 1] - xSeq[0]))*(Math.Abs(ySeq[ySeq.Length - 1] - ySeq[0]));
		
		//XY
		for(int xIdx = 1; xIdx < xSeq.Length ; xIdx++){
			for(int yIdx = 1; yIdx < ySeq.Length ; yIdx++){
				sumSquare += Math.Abs(xSeq[xIdx] - xSeq[xIdx - 1])*Math.Abs(ySeq[yIdx] - ySeq[yIdx - 1]);
			}
		}
		
		//X
		for(int yIdx = 1; yIdx < ySeq.Length ; yIdx++){
			sumSquare += Math.Abs(xSeq[xSeq.Length - 1] - xSeq[0])*Math.Abs(ySeq[yIdx] - ySeq[yIdx - 1]);
		}	
		//Y
		for(int xIdx = 1; xIdx < xSeq.Length ; xIdx++){
			sumSquare += Math.Abs(ySeq[ySeq.Length - 1] - ySeq[0])*Math.Abs(xSeq[xIdx] - xSeq[xIdx - 1]);
		}
		
		int ans = sumSquare % 1000000007;
		Console.WriteLine(ans.ToString());
	}
}	