#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int xnum, ynum;
  vector<int> x, y;
  x.push_back(0), y.push_back(0);
  cin >> xnum >> ynum;
  for (int(i) = 0; (i) < (xnum); (i)++) {
    int temp;
    cin >> temp;
    x.push_back(temp);
  }
  for (int(i) = 0; (i) < (ynum); (i)++) {
    int temp;
    cin >> temp;
    y.push_back(temp);
  }
  ll xsum = 0, ysum = 0;
  for (int i = 1; i <= xnum; i++) xsum += (2 * i - xnum - 1) * x[i];
  for (int i = 1; i <= ynum; i++) ysum += (2 * i - ynum - 1) * y[i];
  int ans = (xsum * ysum) % 1000000007;
  cout << ans << endl;
  return 0;
}
