#include <bits/stdc++.h>
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int ndx[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int ndy[8] = {1, 0, -1, 0, 1, -1, -1, 1};
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }
double log(double a, double b) { return log(b) / log(a); }
int main() {
  int n0, m0;
  cin >> n0 >> m0;
  vector<long long> x0(n0), y0(m0);
  for (int i = 0; i < n0; i++) {
    cin >> x0[i];
  }
  for (int i = 0; i < m0; i++) {
    cin >> y0[i];
  }
  int n = n0 - 1, m = m0 - 1;
  vector<long long> x(n), y(m);
  for (int i = 0; i < n; i++) {
    x[i] = x0[i + 1] - x0[i];
  }
  for (int i = 0; i < m; i++) {
    y[i] = y0[i + 1] - y0[i];
  }
  long long ans0 = 0;
  for (int i = 0; i < n; i++) {
    ans0 += ((((i + 1) * (n - i)) % 1000000007) * x[i]) % 1000000007;
    ans0 = ans0 % 1000000007;
  }
  long long ans = 0;
  for (int i = 0; i < m; i++) {
    ans += ((((((i + 1) * (m - i)) % 1000000007) * ans0) % 1000000007) * y[i]) %
           1000000007;
    ;
    ans = ans % 1000000007;
  }
  cout << ans << endl;
}
