#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int x[n], y[m];
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> y[i];
  auto f = [](int n, int x[]) {
    int res = 0;
    for (int i = 0; i < n; i++) {
      int pls = 1LL * x[i] * i % 1000000007;
      int mns = 1LL * x[i] * (n - 1 - i) % 1000000007;
      res = (1LL * res + pls - mns) % 1000000007;
    }
    return res;
  };
  cout << 1LL * f(n, x) * f(m, y) % 1000000007 << endl;
}
