import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;

string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

void main(){
	int n = read.to!int;
	int m = read.to!int;
	long[] xs = readln.chomp.split.map!(to!long).array;
	long[] ys = readln.chomp.split.map!(to!long).array;
	
	long[] sx = [0];
	for(int i = 1; i < n; i ++){
		sx ~= sx[i - 1] + i * (xs[i] - xs[i - 1]);
		}
	long tx = 0;
	for(int i = 0; i < n; i ++){
		tx += sx[i];
		}
	
	long[] sy = [0];
	for(int j = 1; j < m; j ++){
		sy ~= sy[j - 1] + j * (ys[j] - ys[j - 1]);
		}
	long ty = 0;
	for(int j = 0; j < m; j ++){
		ty += sy[j];
		}
	
	BigInt ans;
	ans = tx;
	ans *= ty;
	ans %= 1_000_000_007;
	
	ans.writeln;
	
	}
