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