#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int x[100001], y[100001];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> y[i];
  }
  int xsum = 0, ysum = 0, xsub = 0, ysub = 0;
  for (int i = 0; i < n; i++) {
    xsum += x[i] * i;
    xsub += x[i] * (n - i - 1);
  }
  for (int i = 0; i < m; i++) {
    ysum += y[i] * i;
    ysub += y[i] * (m - i - 1);
  }
  cout << ((xsum - xsub) * (ysum - ysub)) % int(pow(10, 9) + 7) << endl;
}
