#include <bits/stdc++.h>
using namespace std;
long long calcCombination(int n, int r) {
  if (n == r || r == 0) {
    return 1;
  } else {
    return calcCombination(n, r - 1) * (n - r + 1) / r;
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  int x[n], y[m];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> y[i];
  }
  long long widthCombination = calcCombination(n, 2);
  long long heightCombination = calcCombination(m, 2);
  long long widths[widthCombination];
  long long heights[heightCombination];
  int cnt = 0;
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      widths[cnt++] = x[j] - x[i];
    }
  }
  cnt = 0;
  for (int i = 0; i < m - 1; i++) {
    for (int j = i + 1; j < m; j++) {
      heights[cnt++] = y[j] - y[i];
    }
  }
  long long sum = 0;
  for (long long i = 0; i < widthCombination; i++) {
    for (long long j = 0; j < heightCombination; j++) {
      sum += widths[i] * heights[j] % 1000000007;
    }
  }
  cout << sum % 1000000007 << endl;
  return 0;
}
