#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n, m;
  cin >> n >> m;
  vector<long long> x(n);
  vector<long long> y(m);
  long long sum = 0;
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> y[i];
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      for (int k = 0; k < m - 1; k++) {
        for (int l = k + 1; l < m; l++)
          sum = (sum + (x[j] - x[i]) * (y[l] - y[k])) % 1000000007;
      }
    }
  }
  cout << sum << flush;
  return 0;
}
