#include <bits/stdc++.h>
#define FOR(I,X,Y) for(long long (I)=(X);(I)<(Y);(I)++)
#define REP(I,X,Y) for(long long (I)=(Y)-1;(I)>=(X);(I)--)
#define ALL(X) (X).begin(),(X).end()
#define INF 1000000007
#define LINF 1000000000000000007
typedef long long ll;
using namespace std;

int main(){
  ll n,m,inf=INF;
  cin >> n >> m;
  ll xsum = 0,ysum = 0,x,y;
  FOR(i,0,n){
    cin >> x;
    xsum += (2*i+1-n)*x;
    xsum %= inf;
  }
  FOR(i,0,m){
    cin >> y;
    ysum += (2*i+1-m)*y;
    ysum %= inf;
  }
  cout << xsum*ysum%inf << endl;
}
