#include <iostream>
using namespace std;
#define MOD 1000000007

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 % MOD;
      int mns = 1LL * x[i] * (n-1-i) % MOD;
      res = (1LL * res + pls - mns) % MOD;
    }
    return res < 0 ? res + MOD : res;
  };
  cout << 1LL * f(n, x) * f(m, y) % MOD << endl;
}