#include <bits/stdc++.h>
using namespace std;
int dx4[4] = {1, 0, -1, 0};
int dy4[4] = {0, -1, 0, 1};
int dx8[8] = {1, 0, -1, 1, -1, 1, 0, -1};
int dy8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
int dx9[9] = {0, 1, 0, -1, 1, -1, 1, 0, -1};
int dy9[9] = {0, 1, 1, 1, 0, 0, -1, -1, -1};
const int INF = 1e9;
const long long LLINF = 1e18;
const int MAX_V = 1e6 + 1;
const long long mod = 1000000007;
int n, m;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> m;
  vector<int> x(n);
  vector<int> y(n);
  for (int i = 0; i < (int)(n); i++) cin >> x[i];
  for (int i = 0; i < (int)(m); i++) cin >> y[i];
  long long xsum = 0;
  for (int i = (1); i < (int)(n); i++) {
    long long t = x[i] - x[i - 1] % mod;
    t = t * i % mod * (n - i) % mod;
    xsum = (xsum + t) % mod;
  }
  long long ysum = 0;
  for (int i = (1); i < (int)(m); i++) {
    long long t = y[i] - y[i - 1] % mod;
    t = t * i % mod * (m - i) % mod;
    ysum = (ysum + t) % mod;
  }
  cout << (xsum * ysum % mod) << endl;
}
