
#include <iostream>
#include <string.h>
#include <algorithm>
#include <vector>
#include <queue>

using namespace std;
typedef long long ll;
const int INF=1000000;
ll x[100001],y[100001];
ll x2[100001]={};
ll y2[100001]={};
int main() {
	int n,m;
	cin>>n>>m;
	for(int i=1;i<=n;++i){
		cin>>x[i];
		x2[i]=x2[i-1]+x[i];
	}
	for(int i=1;i<=m;++i){
		cin>>y[i];
		y2[i]=y2[i-1]+y[i];
	}
	ll r=0;
	ll x3=0,y3=0;
	for(int i=1;i<n;++i)x3=(x3+x2[n]-x2[i]-x[i]*(n-i))%1000000007;
	for(int i=1;i<m;++i)y3=(y3+y2[m]-y2[i]-y[i]*(m-i))%1000000007;
	cout<<(x3*y3)%1000000007<<endl;
	return 0;
}
