#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<deque>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define ll __int64
//#define ll long long
#define P pair<ll,ll>
const ll mod=1000000007;
int n,m;
ll x[111111],y[111111];
ll rx[111111],ry[111111];
ll a1,a2;

int main(){
	cin>>n>>m;
	rep(i,n)cin>>x[i];
	rep(i,m)cin>>y[i];
	rep(i,n)rx[i]=(i-(n-1))+i;
	rep(i,m)ry[i]=(i-(m-1))+i;
	rep(i,n)a1=(a1%mod+(rx[i]*x[i])%mod)%mod;
	rep(i,m)a2=(a2%mod+(ry[i]*y[i])%mod)%mod;
	cout<<(a1*a2)%mod<<endl;
}	
