#include <bits/stdc++.h>
using namespace std;
int main(){
	int N, M; cin >> N >> M; 
	long long X[100010], Y[100010]; 
	for(int i = 0; i < N; i++) cin >> X[i]; 
	for(int j = 0; j < M; j++) cin >> Y[j]; 
	long long sumX = 0; long long sumY = 0; 
	long long P = 1000000007; 
	for(int i = 1; i < N; i++){
		long long cnt = (long long) i * (N - i) % P; 
		sumX += cnt * (X[i] - X[i-1]) % P; 
		sumX %= P; 
	}
	for(int i = 1; i < M; i++){
		long long cnt = (long long) i * (M - i) % P; 
		sumY += cnt * (Y[i] - Y[i-1]) % P; 
		sumY %= P; 
	}
	cout << sumX * sumY % P << endl; 
}