#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9+7;

int main(){
  
  
ios::sync_with_stdio(false);
cin.tie(nullptr);

  ll N,M; cin >> N >> M;
  vector<ll> x(N); vector<ll> y(M);
  
  for(ll i = 0; i < N; i++){ cin >> x[i];}
  for(ll j = 0; j < M; j++){ cin >> y[j];}
  
  ll ansx = 0LL; ll ansy = 0LL;
  
  for(ll i = 0; i < N; i++){ ansx += (-N+2*i+1)*x[i]; ansx %= MOD;}
  for(ll j = 0; j < M; j++){ ansy += (-M+2*j+1)*y[j]; ansy %= MOD;}
  
  ll ans = (ansx*ansy) % MOD;
  cout << ans << endl; return 0;}
   
  
  
