#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;

#define mod 1000000007

int main(){
	long long n,m;
	cin >> n >> m;
	vector<long long> x(n),y(m);
	for(long long i = 0;i < n;i++){
		cin >> x[i];
	}
	long long xsum = 0;
	for(long long i = 1;i < n;i++){
		long long c = i*(n-i)%mod;
		xsum = (xsum+(x[i]-x[i-1])*c)%mod;
	}
	for(long long i = 0;i < m;i++){
		cin >> y[i];
	}
	long long ysum = 0;
	for(long long i = 1;i < m;i++){
		long long c = i*(m-i);
		ysum = (ysum+(y[i]-y[i-1])*c)%mod;
	}
	cout << xsum*ysum%mod << endl;
}
