#include <bits/stdc++.h>
int main() {
  long long n, m, x[100000], y[100000];
  long long sum = 0;
  scanf("%lld %lld", &n, &m);
  for (int i = 0; i < n; i++) scanf("%lld", &x[i]);
  for (int i = 0; i < m; i++) scanf("%lld", &y[i]);
  for (int x1 = 0; x1 < n - 1; x1++) {
    for (int x2 = x1 + 1; x2 < n; x2++) {
      for (int y1 = 0; y1 < m - 1; y1++) {
        for (int y2 = y1 + 1; y2 < m; y2++) {
          sum += (x[x2] - x[x1]) * (y[y2] - y[y1]);
          sum = sum % (1000000000 + 7);
        }
      }
    }
  }
  printf("%lld", sum % (1000000000 + 7));
}
