#include <bits/stdc++.h>
using namespace std;
int main() {
  int p = pow(10, 9) + 7;
  int n, m;
  cin >> n >> m;
  long long* x = new long long[n];
  long long* y = new long long[m];
  for (size_t i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (size_t i = 0; i < m; i++) {
    cin >> y[i];
  }
  long long Sum = 0;
  for (size_t i = 0; i < n; i++) {
    for (size_t j = i + 1; j < n; j++) {
      for (size_t k = 0; k < m; k++) {
        for (size_t l = k + 1; l < m; l++) {
          Sum += (x[j] - x[i]) * (y[l] - y[k]) % p;
        }
      }
    }
  }
  cout << (Sum % p);
  delete x;
  delete y;
  return 0;
}
