#include <bits/stdc++.h>
using namespace std;
struct node {
  long long x, y;
} e[100050];
int n, m;
int main() {
  long long mod = 1e9 + 7;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%lld", &e[i].x);
  for (int i = 1; i <= m; i++) scanf("%lld", &e[i].y);
  long long sum1 = 0, sum2 = 0;
  for (int k = 1; k <= n; k++)
    sum1 += ((e[k].x - e[k + 1].x) * (n - k) * k) % mod;
  for (int k = 1; k <= m; k++)
    sum2 += ((e[k].y - e[k + 1].y) * (m - k) * k) % mod;
  long long ans = (sum1 * sum2) % mod;
  printf("%lld\n", ans);
  return 0;
}
