#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)n; i++)
typedef long long ll;
const ll mod = 1e9 + 7;

int main(){
  int n, m;
  cin >> n >> m;
  ll x[n+1], y[m+1];
  rep(i, n) cin >> x[i+1];
  rep(i, m) cin >> y[i+1];
  ll mx = 0, my = 0;
  for(int i = 1; i <= n; i++) mx =  (mx + (2*i-n-1)*x[i]) % mod;
  for(int i = 1; i <= m; i++) my =  (my + (2*i-m-1)*y[i]) % mod;
  ll ans = (mx * my) % mod;
  cout << ans << endl;
  return 0;
}
