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