#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
ll n, m, x[100008], y[100008];
ll mod = 1e9+7; 

int main() {
	cin >> n >> m;
	for(ll i = 1; i <= n; i++){cin >> x[i];}
	for(ll j = 1; j <= m; j++){cin >> y[j];}
	ll pseudoh = 0;
	ll pseudow = 0;
	for(ll i = 1; i <= n-1; i++){pseudoh += (i*(n-i)%mod)*(x[i+1]-x[i])%mod; pseudoh %= mod;}
	for(ll j = 1; j <= m-1; j++){pseudow += (j*(m-j)%mod)*(y[j+1]-y[j])%mod; pseudow %= mod;}
	
	cout << pseudoh*pseudow%mod;
	return 0;
}