#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<long long> x, y;
int main() {
  cin >> n >> m;
  x.resize(n);
  y.resize(m);
  for (int i = 0; i < (n); i++) {
    cin >> x[i];
  }
  for (int i = 0; i < (m); i++) {
    cin >> y[i];
  }
  long long ansx = 0, ansy = 0;
  int k;
  for (int i = 0; i < (n); i++) {
    k = 2 * i - n + 1;
    ansx += (long long)k * x[i] % 1000000007;
  }
  for (int i = 0; i < (m); i++) {
    k = 2 * i - m + 1;
    ansy += (long long)k * y[i] % 1000000007;
  }
  cout << (long long)(ansx * ansy) % 1000000007 << endl;
}
