#include <bits/stdc++.h>
long long x[100001], y[100001];
int main(void) {
  long long n, m;
  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]);
  }
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      for (int k = 0; k < m; k++) {
        for (int l = k + 1; l < m; l++) {
          sum += (x[j] - x[i]) * (y[l] - y[k]);
          sum %= 1000000007;
        }
      }
    }
  }
  printf("%lld\n", sum);
  return 0;
}
