#include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1000000007;
using long long = long long;
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
void print(const std::vector<int> &v) {
  std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
  std::cout << std::endl;
}
long long modpow(long long a, long long pair<long long, long long>) {
  if (pair<long long, long long> == 0) return 1;
  if (pair<long long, long long> % 2 == 0) {
    long long halfp = pair<long long, long long> / 2;
    long long half = modpow(a, halfp);
    return half * half % MOD;
  } else {
    return a * modpow(a, pair<long long, long long> - 1) % MOD;
  }
}
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> x(n);
  for (long long i = 0; i < (long long)n; i++) {
    cin >> x[i];
  }
  vector<long long> y(m);
  for (long long i = 0; i < (long long)m; i++) {
    cin >> y[i];
  }
  long long x_sum = 0;
  long long y_sum = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      x_sum += (x[j] - x[i]) % MOD;
      x_sum %= MOD;
    }
  }
  for (int k = 0; k < m; k++) {
    for (int l = k + 1; l < m; l++) {
      y_sum += (y[l] - y[k]) % MOD;
      y_sum %= MOD;
    }
  }
  long long area = x_sum * y_sum % MOD;
  cout << area % MOD << endl;
  return 0;
}
