#include <bits/stdc++.h>
using namespace std;
inline void prep() {
  cin.tie(0);
  cin.sync_with_stdio(0);
};
const double pi = acos(-1.);
long long mod = 1000000007;
long long mymod(long long num) {
  if (num < 0 && !(num % mod == 0)) {
    if (mod == 1) {
      return 0;
    }
    return mod - abs(num) % mod;
  } else {
    return num % mod;
  }
}
double eps = .000000001;
int main() {
  prep();
  int n, m;
  cin >> n >> m;
  long long x[n];
  long long y[m];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> y[i];
  }
  vector<long long> betwx;
  vector<long long> betwy;
  for (int i = 1; i < n; i++) {
    betwx.push_back(mymod((n - i) * (x[i] - x[i - 1])));
  }
  for (int i = 1; i < m; i++) {
    betwy.push_back(mymod((m - i) * (y[i] - y[i - 1])));
  }
  for (int i = n - 3; i >= 0; i--) {
    betwx[i] = mymod(betwx[i + 1] + betwx[i]);
  }
  for (int i = m - 3; i >= 0; i--) {
    betwy[i] = mymod(betwy[i + 1] + betwy[i]);
  }
  long long res = 0;
  for (int i = 0; i < n - 1; i++) {
    for (int j = 0; j < m - 1; j++) {
      res += mymod(betwx[i] * betwy[j]);
      res = mymod(res);
    }
  }
  cout << res;
  return 0;
}
