#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const long long int linf = 1LL << 50;
const double EPS = 1e-10;
const int mod = 1e9 + 7;
long long int sumx[100001], sumy[100001];
int main(int argc, char const* argv[]) {
  int n, m;
  cin >> n >> m;
  vector<long long int> x, y;
  for (int i = 0; i < n; i++) {
    long long int a;
    cin >> a;
    x.push_back(a);
    if (i == 0)
      sumx[0] = a;
    else
      sumx[i] = (sumx[i - 1] + a) % mod;
  }
  for (int i = 0; i < m; i++) {
    long long int b;
    cin >> b;
    y.push_back(b);
    if (i == 0)
      sumy[0] = b;
    else
      sumy[i] = (sumy[i - 1] + b) % mod;
  }
  long long int resx = 0, resy = 0;
  for (int i = 0; i < n; i++) {
    resx = (((((resx + sumx[n - 1]) % mod) - sumx[i]) % mod) -
            (n - i - 1) * x[i] % mod) %
           mod;
  }
  for (int i = 0; i < m; i++) {
    resy = (((((resy + sumy[m - 1]) % mod) - sumy[i]) % mod) -
            (m - i - 1) * y[i] % mod) %
           mod;
  }
  cout << resx * resy % mod << endl;
  return 0;
}
