#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000;
int main() {
  int n, m;
  long long x[100001], y[100001];
  cin >> n >> m;
  for (int i = 0; i < n; ++i) cin >> x[i];
  for (int i = 0; i < m; ++i) cin >> y[i];
  long long r = 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) {
          r = (r + (x[j] - x[i]) * (y[l] - y[k])) % 1000000007;
        }
      }
    }
  }
  cout << r << endl;
  return 0;
}
