#include <bits/stdc++.h>
long long a[100005], b[100005], c[100005], d[100005];
int main() {
  int n, m;
  while (~scanf("%d %d", &m, &n)) {
    for (int i = 0; i < m; i++) {
      scanf("%lld", &a[i]);
    }
    for (int i = 0; i < n; i++) {
      scanf("%lld", &b[i]);
    }
    int t = 0;
    for (int i = 0; i < m - 1; i++)
      for (int j = i + 1; j < m; j++) {
        c[t] = a[j] - a[i];
        t++;
      }
    int k = 0;
    for (int i = 0; i < n - 1; i++)
      for (int j = i + 1; j < n; j++) {
        d[k] = b[j] - b[i];
        k++;
      }
    long long s = 0;
    for (int i = 0; i < t; i++) {
      for (int j = 0; j < k; j++) {
        s += c[i] * d[j];
        while (s > 1000000007) s -= 1000000007;
      }
    }
    printf("%lld\n", s);
  }
}
