#include <bits/stdc++.h>
using namespace std;
long long n, m, x = 0, y = 0, ans;
long long minx = 10000000000, miny = 10000000000, maxx = 0, maxy = 0;
int main() {
  long long i;
  cin >> n >> m;
  cin >> minx;
  for (i = 1; i < n; ++i) {
    cin >> maxx;
    x += ((maxx - minx) * i) % 1000000007 * (n - i) % 1000000007;
    x %= 1000000007;
    minx = maxx;
  }
  cin >> miny;
  for (i = 1; i < m; ++i) {
    cin >> maxy;
    y += ((maxy - miny) * i) % 1000000007 * (m - i) % 1000000007;
    miny = maxy;
  }
  cout << (x * y) % 1000000007 << endl;
  return 0;
}
