#include <bits/stdc++.h>
int main() {
  int n, m;
  std::cin >> n >> m;
  std::vector<long long> x(n), y(m);
  for (auto it = std::begin(x); it != std::end(x); it++) std::cin >> *it;
  for (auto it = std::begin(y); it != std::end(y); it++) std::cin >> *it;
  unsigned long long xsum = 0;
  for (int i = 0; i < n; i++) xsum += x[i] * (i * 2 - n + 1);
  unsigned long long ysum = 0;
  for (int i = 0; i < m; i++) ysum += y[i] * (i * 2 - m + 1);
  std::cout << xsum * ysum % 1000000007;
}
