#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  long long inf = 1e+09 + 7;
  cin >> n >> m;
  long long x[n], y[m];
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < m; i++) cin >> y[i];
  long long sum_x = 0, sum_y = 0;
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      sum_x += x[j] - x[i];
    }
  }
  sum_x = sum_x % inf;
  for (int i = 0; i < m - 1; i++) {
    for (int j = i + 1; j < m; j++) {
      sum_y += y[j] - y[i];
    }
  }
  sum_y = sum_y % inf;
  long long total_sum = sum_x * sum_y % inf;
  cout << total_sum << endl;
}
