#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
using V = vector<T>;
template <class T, class U>
using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;
int n, m;
vll x, y;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  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];
  ll xsum = 0, xtotal = 0;
  for (int i = 1; i < n; i++) {
    xsum += x[i] - x[0];
    if (xsum >= MOD) xsum -= MOD;
  }
  xtotal += xsum;
  for (int i = 1; i < n; i++) {
    xsum -= (x[i] - x[i - 1]) * (n - i) % MOD;
    if (xsum < 0) xsum += MOD;
    xtotal += xsum;
    if (xtotal >= MOD) xtotal -= MOD;
  }
  ll ysum = 0, ytotal = 0;
  for (int i = 1; i < m; i++) {
    ysum += y[i] - y[0];
    if (ysum >= MOD) ysum -= MOD;
  }
  ytotal += ysum;
  for (int i = 1; i < m; i++) {
    ysum -= (y[i] - y[i - 1]) * (m - i) % MOD;
    if (ysum < 0) ysum += MOD;
    ytotal += ysum;
    if (ytotal >= MOD) ytotal -= MOD;
  }
  cout << xtotal * ytotal % MOD << '\n';
  return 0;
}
