#include <bits/stdc++.h>
using namespace std;
long long h[100005], l[100005];
int n, m;
long long x[100005], y[100005];
long long dx[100005], dy[100005];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    int aa;
    scanf("%d", &aa);
    x[i] = aa;
  }
  for (int i = 1; i <= m; i++) {
    int aa;
    scanf("%d", &aa);
    y[i] = aa;
  }
  n--;
  m--;
  for (int i = 1; i <= n; i++) {
    dx[i] = x[i + 1] - x[i];
  }
  for (int i = 1; i <= m; i++) {
    dy[i] = y[i + 1] - y[i];
  }
  for (int i = 1; i <= n; i++) {
    h[i] = i * (n - i + 1);
  }
  for (int i = 1; i <= m; i++) {
    l[i] = i * (m - i + 1);
  }
  long long xx = 0, yy = 0;
  for (int i = 1; i <= n; i++) {
    xx = (xx + i * (n - i + 1) * dx[i]) % 1000000007;
  }
  for (int i = 1; i <= m; i++) {
    yy = (yy + i * (m - i + 1) * dy[i]) % 1000000007;
  }
  cout << xx * yy % 1000000007 << endl;
  return 0;
}
