#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define eps LDBL_EPSILON
#define moder 1000000007
#define int long long
#define ll long long
#define INF LLONG_MAX/3
#define P std::pair<int,int>
#define prique priority_queue<int,vector<int>,greater<int>>
using namespace std;
int n,m,x[100010],y[100010];
vector<int> vec1,vec2;
int c1,c2;
signed main(){
	cin>>n>>m;
	rep(i,n){
		cin>>x[i];
		if(i)c1+=(x[i]-x[i-1])*i*(n-i);
		c1%=moder;
	}
	rep(i,m){
		cin>>y[i];
		if(i)c2+=(y[i]-y[i-1])*i*(m-i);
		c2%=moder;
	}
	cout<<c1*c2%moder<<endl;
	return 0;
}