#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
  out << "[";
  size_t last = v.size() - 1;
  for (size_t i = 0; i < v.size(); ++i) {
    out << v[i];
    if (i != last) out << ",";
  }
  out << "]";
  return out;
}
const long long mod = 1e9 + 7;
int n, m;
const int MAXN = 1e5 + 100;
const int MAXM = 1e5 + 100;
long long x[MAXN] = {};
long long y[MAXM] = {};
long long area(int i, int j, int k, int l) {
  return ((abs(x[j] - x[i]) % mod) * (abs(y[l] - y[k]) % mod)) % mod;
}
long long total = 0;
void solve() {
  long long ret = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      for (int k = 0; k < m; ++k) {
        for (int l = k + 1; l < m; ++l) {
          ret = (ret + area(i, j, k, l)) % mod;
        }
      }
    }
  }
  cout << ret << endl;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }
  for (int i = 0; i < m; ++i) {
    cin >> y[i];
  }
  solve();
}
