#include <bits/stdc++.h>
using namespace std;
long long int A = 0;
long long int B = 0;
void modA() {
  if (A >= 1000000007) {
    A %= 1000000007;
  }
}
void modB() {
  if (B >= 1000000007) {
    B %= 1000000007;
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  long long int x[n], y[m];
  for (int i = 0; i < (int)(n); i++) {
    cin >> x[i];
    while (x[i] < 0) {
      x[i] += 1000000007;
    }
  }
  for (int i = 0; i < (int)(m); i++) {
    cin >> y[i];
    while (y[i] < 0) {
      y[i] += 1000000007;
    }
  }
  for (long long int k = 1; k <= n; ++k) {
    A += (2 * k - n - 1) * x[k - 1];
    void modA();
  }
  for (long long int k = 1; k <= m; ++k) {
    B += (2 * k - m - 1) * y[k - 1];
    void modB();
  }
  long long int P = A * B;
  while (P < 0) {
    P += 1000000007;
  }
  cout << P % 1000000007 << endl;
  return 0;
}
