#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> x(n);
  vector<long long> y(m);
  unsigned long long sumx = 0, sumy = 0;
  for (int i = 0; i < n; ++i) {
    cin >> x[i];
    for (int j = 0; j < i; ++j) sumx += (x[i] - x[j]) % 1000000007;
  }
  for (int i = 0; i < m; ++i) {
    cin >> y[i];
    for (int j = 0; j < i; ++j) sumy += (y[i] - y[j]) % 1000000007;
  }
  cout << (sumx * sumy) % 1000000007 << endl;
  return 0;
}
