#include <bits/stdc++.h>
using namespace std;
int64_t count(const vector<int> v) {
  const int n = v.size();
  int64_t a = 0;
  for (int i = 0; i < n - 1; ++i) {
    for (int j = i + 1; j < n; ++j) {
      a += v[j] - v[i];
    }
  }
  return a % static_cast<int64_t>(1000000000 + 7);
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> x_list, y_list;
  x_list.reserve(n);
  y_list.reserve(n);
  for (int i = 0; i < n; ++i) {
    int t;
    cin >> t;
    x_list.push_back(t);
  }
  for (int i = 0; i < m; ++i) {
    int t;
    cin >> t;
    y_list.push_back(t);
  }
  const int64_t size_x = count(x_list), size_y = count(y_list);
  const int64_t r = (size_x * size_y) % static_cast<int64_t>(1000000000 + 7);
  cout << r << endl;
  return 0;
}
