#include <bits/stdc++.h>
using namespace std;

int main(){
 	int n,m;
	cin >>n >> m;
	vector<long> x(n);
	vector<long> y(m);
  	for(int i = 0; i < n; i++) {
		cin >> x[i];
	}
  	for(int i = 0; i < m; i++) {
		cin >> y[i];
	}
  	long t=0;
	long tmp=0;
	for(int i = 0; i *2< n-1;i++) {
		tmp += (n-1-2*i)*(x[n-1-i]-x[i]);
	}
  	tmp %= (long)1E9+7;
  	for(int j = 0; j*2 < m-1; j++) {
		t +=(m-1-2*j) * (y[m-1-j]-y[j]);
	}
  	t %= (long)1E9+7;
  	t *= tmp;
  
  	t %= (long)1E9+7;
  	cout << t << endl;
	
}
