#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
ll n,m;
ll x[100004];
ll y[100004];
int main() {
  cin >> n >> m;

  for(int i = 1; i <= n; i++) cin >> x[i];

  for(int j = 1; j <= m; j++) cin >> y[j];

  ll sum_x = 0;
  for(ll k = 1; k <= n; k++) {
    sum_x += (k * 2 - n - 1) * x[k] % mod;
  }
  ll sum_y = 0;
  for(ll k = 1; k <= m; k++) {
    sum_y += (k * 2 - m - 1) * y[k] % mod;
  }

  cout << (sum_x % mod) * (sum_y % mod)  % mod <<endl;
}
  
