#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long x[n], y[m];
  for (int i = 0; i < n; i++) {
    long long tmp;
    cin >> tmp;
    x[i] = tmp;
  }
  for (int i = 0; i < m; i++) {
    long long tmp;
    cin >> tmp;
    y[i] = tmp;
  }
  long long sum_x = 0;
  for (int k = 0; k < n; k++) {
    sum_x += k * x[k] - (n - k - 1) * x[k];
  }
  long long sum_y = 0;
  for (int k = 0; k < m; k++) {
    sum_y += k * y[k] - (m - k - 1) * y[k];
  }
  const long long mod = 1000000007;
  cout << (sum_x % mod) * (sum_y % mod) << endl;
  return 0;
}
