#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
istream &operator>>(istream &is, vector<pair<T1, T2>> &v) {
  for (pair<T1, T2> &t : v) is >> t.first >> t.second;
  return is;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (T &t : v) is >> t;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (const T &t : v) {
    os << t << " ";
  }
  os << '\n';
  return os;
}
double pi = acos(-1.0);
const long long md = 1e9 + 7;
const long long INF = 1e15;
long long dx1[] = {0, 0, -1, 1};
long long dy1[] = {1, -1, 0, 0};
template <class T>
T abst(T a) {
  return a < 0 ? -a : a;
}
template <class T>
T max2(T a, T b) {
  return a > b ? a : b;
}
template <class T>
T min2(T a, T b) {
  return a < b ? a : b;
}
void solve() {
  long long n, m;
  cin >> n >> m;
  vector<long long> x(n);
  cin >> x;
  vector<long long> y(m);
  cin >> y;
  vector<long long> post(n);
  post[n - 1] = 0;
  for (long long i = n - 2; i >= 0; i--) {
    post[i] = post[i + 1] + x[i + 1];
    post[i] %= md;
  }
  long long ans = 0;
  long long ycal = 0;
  for (long long i = 0; i < m; i++) {
    ycal = ycal + i * y[i] - (m - (i + 1)) * y[i];
    ycal %= md;
  }
  for (long long i = 0; i < n; i++) {
    ans = ans + ycal * (post[i] - (n - (i + 1)) * x[i]);
    ans %= md;
  }
  cout << ans;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  for (long long i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
