#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
long long x[100000];
long long y[100000];
int main() {
  int n, m;
  long long xsum = 0;
  long long ysum = 0;
  long long ans;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    x[i] += 1e9;
  }
  for (int i = 0; i < m; i++) {
    cin >> y[i];
    y[i] += 1e9;
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      xsum += (x[j] - x[i]);
      xsum %= MOD;
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = i + 1; j < m; j++) {
      ysum += (y[j] - y[i]);
      ysum %= MOD;
    }
  }
  ans = (xsum * ysum) % MOD;
  cout << ans << endl;
  return 0;
}
