#include <bits/stdc++.h>
const int inf = 1e9 + 7;
const long long infll = 1ll << 60ll;
const long long mod = 1e9 + 7;
constexpr int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, -1, 0, 1, 1, -1, -1, 1};
namespace {
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
}  // namespace
int main() {
  int n, m;
  std::cin >> n >> m;
  std::vector<long long> x(n), y(m);
  for (int i = 0; i < n; i++) {
    std::cin >> x[i];
    x[i] += 1e9;
  }
  for (int j = 0; j < m; j++) {
    std::cin >> y[j];
    y[j] += 1e9;
  }
  long long ans = 0;
  long long lengthSum = 0;
  std::vector<long long> len(n, 0);
  for (int i = 0; i < n - 1; i++) {
    len[0] += x[i + 1] - x[0];
  }
  for (int i = 0; i < n - 1; i++) {
    len[i + 1] = len[i] - (x[i + 1] - x[i]) * (n - i - 1);
    len[i + 1] %= mod;
  }
  len[0] %= mod;
  lengthSum = std::accumulate((len).begin(), (len).end(), 0LL);
  long long ylengthSum = 0;
  std::vector<long long> ylen(n, 0);
  for (int i = 0; i < m - 1; i++) {
    ylen[0] += y[i + 1] - y[0];
  }
  for (int i = 0; i < m - 1; i++) {
    ylen[i + 1] = ylen[i] - (y[i + 1] - y[i]) * (m - i - 1);
    ylen[i + 1] %= mod;
  }
  ylen[0] %= mod;
  ylengthSum = std::accumulate((ylen).begin(), (ylen).end(), 0LL);
  std::cout << lengthSum * ylengthSum % mod << std::endl;
  return 0;
}
