#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void _cin() {}
template <class Head, class... Tail>
void _cin(Head&& head, Tail&&... tail) {
  cin >> head;
  _cin(forward<Tail>(tail)...);
}
void _cout() { cout << "\n"; }
template <class Head, class... Tail>
void _cout(Head&& head, Tail&&... tail) {
  cout << head;
  _cout(forward<Tail>(tail)...);
}
int gcd(int a, int b) { return (b == 0) ? a : gcd(b, a % b); }
template <typename S, typename T>
ostream& operator<<(ostream& os, const pair<S, T>& p) {
  cout << "[" << p.first << ", " << p.second << "]";
  return os;
}
constexpr int MOD = 1e9 + 7;
int main(void) {
  int n, m;
  _cin(n, m);
  vector<int> x(n);
  for (int i = 0; i < (n); i++) cin >> x[i];
  vector<int> y(m);
  for (int i = 0; i < (m); i++) cin >> y[i];
  ll lx = 0, ly = 0;
  for (int i = 0; i < (n - 1); i++) {
    lx += ((ll)(i + 1) * (n - 1 - i) % MOD) * ((x[i + 1] - x[i]) % MOD) % MOD;
  }
  for (int j = 0; j < (m - 1); j++) {
    ly += ((ll)(j + 1) * (m - 1 - j) % MOD) * ((y[j + 1] - y[j]) % MOD) % MOD;
  }
  _cout(lx * ly % MOD);
}
