#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 6;
const long long MOD = 1e9 + 7;
const long long LLINF = 1LL << 50;
long long modpow(long long a, long long n) {
  long long ret = 1;
  for (int i = 1; i <= n; i = i << 1) {
    if (i & n) {
      ret = a * ret % MOD;
    }
    a = (a * a) % MOD;
  }
  return ret;
}
int main() {
  long long n, m;
  cin >> n >> m;
  long long x[n], y[m];
  for (int i = int(0); i < int(n); i++) cin >> x[i];
  for (int i = int(0); i < int(m); i++) cin >> y[i];
  long long sumx[n + 1], sumy[n + 1];
  sumx[0] = 0, sumy[0] = 0;
  for (int i = int(0); i < int(n); i++) sumx[i + 1] = x[i] + sumx[i];
  for (int i = int(0); i < int(m); i++) sumy[i + 1] = y[i] + sumy[i];
  long long ansx = 0, ansy = 0;
  for (int i = int(0); i < int(n - 1); i++) {
    ansx =
        (ansx + sumx[n] - sumx[i + 1] - (n - 1 - long long(i)) * x[i] % MOD) %
        MOD;
  }
  for (int i = int(0); i < int(m - 1); i++) {
    ansy =
        (ansy + sumy[m] - sumy[i + 1] - (m - 1 - long long(i)) * y[i] % MOD) %
        MOD;
  }
  cout << ansx * ansy % MOD << endl;
}
