#include <bits/stdc++.h>
using namespace std;
int sumit(int n, long long int *a) {
  long long int suma = 0;
  long long int ax1, ax2;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      suma += a[j] - a[i];
      suma %= 1000000007;
    }
  }
  return suma;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  long long int sumx, sumy;
  long long int sum;
  long long int x[100005], y[100005];
  for (int i = 0; i < n; i++) {
    scanf("%lld", &x[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%lld", &y[i]);
  }
  sumx = sumit(n, x);
  sumy = sumit(m, y);
  sum = sumx * sumy;
  sum %= 1000000007;
  printf("%lld\n", sum);
  return 0;
}
