#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

typedef long long LL;

const int inf = 1 << 26;
const int mod = 1e9+7;

int n, m;
LL ta, tb;

int main(){
	cin >> n >> m;
	vector<LL> a(n);
	vector<LL> b(m);
	for ( int i = 0; i < n; i ++ ) {
		cin >> a[i];
	}
	for ( int i = 0; i < m; i ++ ) {
		cin >> b[i];
	}
	
	for ( int i = 0; i < n; i ++ ) {
		ta -= a[i]*(n-i-1);
		ta += a[i]*i;
	}
	
	for ( int i = 0; i < m; i ++ ) {
		tb -= b[i]*(m-i-1);
		tb += b[i]*i;
	}
	
	LL q = (abs(ta%mod))*(abs(tb%mod))%mod;
	cout << q << endl;

	return 0;
}
