#include <bits/stdc++.h>
using namespace std;
long long sumOfDiffs(vector<int> ns) {
  int N = ns.size();
  vector<long long> sumAt(N, 0);
  for (int i = 0; i < N; ++i) {
    sumAt[i] = (ns[i] * (2 * i - N + 1)) % 1000000007;
  }
  long long res = 0;
  for (long long sum : sumAt) {
    res = (res + sum) % 1000000007;
  }
  return res;
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  vector<int> cols(n, 0);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &cols[i]);
  }
  vector<int> rows(m, 0);
  for (int i = 0; i < m; ++i) {
    scanf("%d", &rows[i]);
  }
  printf("%lld", (sumOfDiffs(cols) * sumOfDiffs(rows)) % 1000000007);
  return 0;
}
