#include <bits/stdc++.h>
int main() {
  int n, m;
  long long x[100000];
  long long y[100000];
  scanf("%d %d", &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 tmp = 0, tmp2 = 0;
  for (int i = 1; i <= n; i++) {
    tmp += (((i - 1) * x[i - 1]) - ((n - i) * x[i - 1])) % 1000000007;
  }
  for (int i = 1; i <= m; i++) {
    tmp2 += ((i - 1) * y[i - 1] - (m - i) * y[i - 1]) % 1000000007;
  }
  printf("%lld\n", (tmp % 1000000007 * tmp2 % 1000000007) % 1000000007);
}
